summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-10-10 15:45:57 -0600
committerBrian <brian.paul@tungstengraphics.com>2007-10-10 15:45:57 -0600
commitd0bca086ab6d032909e9a429720fea297c536f97 (patch)
treec28e22f04123f66abe74e1fa57e374ef1f4728e1
parent9f8cfa75ca0882a8015a714887b41f8a7a10fd19 (diff)
fix get_result_vector() since fp output slots are not fixed anymore
-rw-r--r--src/mesa/pipe/i915simple/i915_fpc.h3
-rw-r--r--src/mesa/pipe/i915simple/i915_fpc_translate.c30
2 files changed, 25 insertions, 8 deletions
diff --git a/src/mesa/pipe/i915simple/i915_fpc.h b/src/mesa/pipe/i915simple/i915_fpc.h
index 5fdc7ef27e..c25f5abf0e 100644
--- a/src/mesa/pipe/i915simple/i915_fpc.h
+++ b/src/mesa/pipe/i915simple/i915_fpc.h
@@ -54,6 +54,9 @@ struct i915_fp_compile {
uint input_semantic_name[PIPE_MAX_SHADER_INPUTS];
uint input_semantic_index[PIPE_MAX_SHADER_INPUTS];
+ uint output_semantic_name[PIPE_MAX_SHADER_OUTPUTS];
+ uint output_semantic_index[PIPE_MAX_SHADER_OUTPUTS];
+
/** points into the i915->current.constants array: */
float (*constants)[4];
uint num_constants;
diff --git a/src/mesa/pipe/i915simple/i915_fpc_translate.c b/src/mesa/pipe/i915simple/i915_fpc_translate.c
index 24bb1d3e2a..f34225bfed 100644
--- a/src/mesa/pipe/i915simple/i915_fpc_translate.c
+++ b/src/mesa/pipe/i915simple/i915_fpc_translate.c
@@ -240,14 +240,17 @@ get_result_vector(struct i915_fp_compile *p,
{
switch (dest->DstRegister.File) {
case TGSI_FILE_OUTPUT:
- switch (dest->DstRegister.Index) {
- case 0: /**TGSI_ATTRIB_POS:**/
- return UREG(REG_TYPE_OD, 0);
- case 1: /**TGSI_ATTRIB_COLOR0:**/
- return UREG(REG_TYPE_OC, 0);
- default:
- i915_program_error(p, "Bad inst->DstReg.Index");
- return 0;
+ {
+ uint sem_name = p->output_semantic_name[dest->DstRegister.Index];
+ switch (sem_name) {
+ case TGSI_SEMANTIC_POSITION:
+ return UREG(REG_TYPE_OD, 0);
+ case TGSI_SEMANTIC_COLOR:
+ return UREG(REG_TYPE_OC, 0);
+ default:
+ i915_program_error(p, "Bad inst->DstReg.Index/semantics");
+ return 0;
+ }
}
case TGSI_FILE_TEMPORARY:
return UREG(REG_TYPE_R, dest->DstRegister.Index);
@@ -867,6 +870,17 @@ i915_translate_instructions(struct i915_fp_compile *p,
p->input_semantic_name[ind] = sem;
p->input_semantic_index[ind] = semi;
}
+ else if (parse.FullToken.FullDeclaration.Declaration.File
+ == TGSI_FILE_OUTPUT) {
+ /* save output register info for use in get_result_vector() */
+ uint ind, sem, semi;
+ ind = parse.FullToken.FullDeclaration.u.DeclarationRange.First;
+ sem = parse.FullToken.FullDeclaration.Semantic.SemanticName;
+ semi = parse.FullToken.FullDeclaration.Semantic.SemanticIndex;
+ /*printf("FS Output DECL [%u] sem %u\n", ind, sem);*/
+ p->output_semantic_name[ind] = sem;
+ p->output_semantic_index[ind] = semi;
+ }
break;
case TGSI_TOKEN_TYPE_IMMEDIATE: