const ubyte inputSemanticName[],\r
const ubyte inputSemanticIndex[],\r
const GLuint interpMode[],\r
+ GLuint numOutputs,\r
const GLuint outputMapping[],\r
+ const ubyte outputSemanticName[],\r
+ const ubyte outputSemanticIndex[],\r
struct tgsi_token *tokens,\r
GLuint maxTokens )\r
{\r
/*\r
* Declare output attributes.\r
*/\r
- assert(\r
- program->Base.OutputsWritten ==\r
- (program->Base.OutputsWritten & ((1 << FRAG_RESULT_COLR) | (1 << FRAG_RESULT_DEPR))) );\r
-\r
- fulldecl = make_output_decl(\r
- 0,\r
- TGSI_SEMANTIC_POSITION, 0, /* Z / Depth */\r
- TGSI_WRITEMASK_Z );\r
- ti += tgsi_build_full_declaration(\r
- &fulldecl,\r
- &tokens[ti],\r
- header,\r
- maxTokens - ti );\r
-\r
- if( program->Base.OutputsWritten & (1 << FRAG_RESULT_COLR) ) {\r
- fulldecl = make_output_decl(\r
- 1,\r
- TGSI_SEMANTIC_COLOR, 0,\r
- TGSI_WRITEMASK_XYZW );\r
- ti += tgsi_build_full_declaration(\r
- &fulldecl,\r
- &tokens[ti],\r
- header,\r
- maxTokens - ti );\r
+ for (i = 0; i < numOutputs; i++) {\r
+ switch (outputSemanticName[i]) {\r
+ case TGSI_SEMANTIC_POSITION:\r
+ fulldecl = make_output_decl(i,\r
+ TGSI_SEMANTIC_POSITION, 0, /* Z / Depth */\r
+ TGSI_WRITEMASK_Z );\r
+ ti += tgsi_build_full_declaration(\r
+ &fulldecl,\r
+ &tokens[ti],\r
+ header,\r
+ maxTokens - ti );\r
+ break;\r
+ case TGSI_SEMANTIC_COLOR:\r
+ fulldecl = make_output_decl(i,\r
+ TGSI_SEMANTIC_COLOR, 0,\r
+ TGSI_WRITEMASK_XYZW );\r
+ ti += tgsi_build_full_declaration(\r
+ &fulldecl,\r
+ &tokens[ti],\r
+ header,\r
+ maxTokens - ti );\r
+ break;\r
+ default:\r
+ abort();\r
+ }\r
}\r
\r
/*\r
const ubyte inputSemanticName[],\r
const ubyte inputSemanticIndex[],\r
const GLuint interpMode[],\r
+ GLuint numOutputs,\r
const GLuint outputMapping[],\r
+ const ubyte outputSemanticName[],\r
+ const ubyte outputSemanticIndex[],\r
struct tgsi_token *tokens,\r
GLuint maxTokens );\r
\r