aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-10-09 16:20:00 -0600
committerBrian <[email protected]>2007-10-09 16:20:00 -0600
commit578962d6240252567cb9725a71e9854ad0dc72a0 (patch)
tree117b458b081f96c80bead3d90ce8077c65d5f66f /src/mesa
parentbc139a19b00f8686caa8db7c56af2087f26e369a (diff)
Finish up decls for packed fragment program outputs.
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/pipe/tgsi/mesa/mesa_to_tgsi.c52
-rw-r--r--src/mesa/pipe/tgsi/mesa/mesa_to_tgsi.h3
-rw-r--r--src/mesa/state_tracker/st_program.c3
3 files changed, 34 insertions, 24 deletions
diff --git a/src/mesa/pipe/tgsi/mesa/mesa_to_tgsi.c b/src/mesa/pipe/tgsi/mesa/mesa_to_tgsi.c
index 5a1ec3553e3..66b8db07f95 100644
--- a/src/mesa/pipe/tgsi/mesa/mesa_to_tgsi.c
+++ b/src/mesa/pipe/tgsi/mesa/mesa_to_tgsi.c
@@ -516,7 +516,10 @@ tgsi_mesa_compile_fp_program(
const ubyte inputSemanticName[],
const ubyte inputSemanticIndex[],
const GLuint interpMode[],
+ GLuint numOutputs,
const GLuint outputMapping[],
+ const ubyte outputSemanticName[],
+ const ubyte outputSemanticIndex[],
struct tgsi_token *tokens,
GLuint maxTokens )
{
@@ -580,30 +583,31 @@ tgsi_mesa_compile_fp_program(
/*
* Declare output attributes.
*/
- assert(
- program->Base.OutputsWritten ==
- (program->Base.OutputsWritten & ((1 << FRAG_RESULT_COLR) | (1 << FRAG_RESULT_DEPR))) );
-
- fulldecl = make_output_decl(
- 0,
- TGSI_SEMANTIC_POSITION, 0, /* Z / Depth */
- TGSI_WRITEMASK_Z );
- ti += tgsi_build_full_declaration(
- &fulldecl,
- &tokens[ti],
- header,
- maxTokens - ti );
-
- if( program->Base.OutputsWritten & (1 << FRAG_RESULT_COLR) ) {
- fulldecl = make_output_decl(
- 1,
- TGSI_SEMANTIC_COLOR, 0,
- TGSI_WRITEMASK_XYZW );
- ti += tgsi_build_full_declaration(
- &fulldecl,
- &tokens[ti],
- header,
- maxTokens - ti );
+ for (i = 0; i < numOutputs; i++) {
+ switch (outputSemanticName[i]) {
+ case TGSI_SEMANTIC_POSITION:
+ fulldecl = make_output_decl(i,
+ TGSI_SEMANTIC_POSITION, 0, /* Z / Depth */
+ TGSI_WRITEMASK_Z );
+ ti += tgsi_build_full_declaration(
+ &fulldecl,
+ &tokens[ti],
+ header,
+ maxTokens - ti );
+ break;
+ case TGSI_SEMANTIC_COLOR:
+ fulldecl = make_output_decl(i,
+ TGSI_SEMANTIC_COLOR, 0,
+ TGSI_WRITEMASK_XYZW );
+ ti += tgsi_build_full_declaration(
+ &fulldecl,
+ &tokens[ti],
+ header,
+ maxTokens - ti );
+ break;
+ default:
+ abort();
+ }
}
/*
diff --git a/src/mesa/pipe/tgsi/mesa/mesa_to_tgsi.h b/src/mesa/pipe/tgsi/mesa/mesa_to_tgsi.h
index cf85eb9c0b1..29e80533690 100644
--- a/src/mesa/pipe/tgsi/mesa/mesa_to_tgsi.h
+++ b/src/mesa/pipe/tgsi/mesa/mesa_to_tgsi.h
@@ -15,7 +15,10 @@ tgsi_mesa_compile_fp_program(
const ubyte inputSemanticName[],
const ubyte inputSemanticIndex[],
const GLuint interpMode[],
+ GLuint numOutputs,
const GLuint outputMapping[],
+ const ubyte outputSemanticName[],
+ const ubyte outputSemanticIndex[],
struct tgsi_token *tokens,
GLuint maxTokens );
diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c
index 0b14830353c..1c5af7b75fa 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -394,7 +394,10 @@ st_translate_fragment_program(struct st_context *st,
fs.input_semantic_index,
interpMode,
/* outputs */
+ fs.num_outputs,
outputMapping,
+ fs.output_semantic_name,
+ fs.output_semantic_index,
/* tokenized result */
tokensOut, maxTokens);