| 899 | : OutputStrategy(pCodeGen, world), declPrefix(prefix) |
| 900 | {} |
| 901 | virtual void DeclareOutput(CodeGenContext & ctx, ILStage *) override |
| 902 | { |
| 903 | int location = 0; |
| 904 | for (auto & field : world->OutputType->Members) |
| 905 | { |
| 906 | if (field.Value.Attributes.ContainsKey("FragDepth")) |
| 907 | continue; |
| 908 | ctx.GlobalHeader << "layout(location = " << location << ") "; |
| 909 | if (declPrefix.Length()) |
| 910 | ctx.GlobalHeader << declPrefix << " "; |
| 911 | if (field.Value.Type->IsIntegral()) |
| 912 | ctx.GlobalHeader << "flat "; |
| 913 | ctx.GlobalHeader << "out "; |
| 914 | String declName = field.Key; |
| 915 | codeGen->PrintDef(ctx.GlobalHeader, field.Value.Type.Ptr(), AddWorldNameSuffix(declName, world->OutputType->TypeName)); |
| 916 | ctx.GlobalHeader << ";\n"; |
| 917 | location++; |
| 918 | } |
| 919 | } |
| 920 | virtual void ProcessExportInstruction(CodeGenContext & ctx, ExportInstruction * instr) override |
| 921 | { |
| 922 | if (world->OutputType->Members[instr->ComponentName]().Attributes.ContainsKey("FragDepth")) |
nothing calls this directly
no test coverage detected