summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-10-30 18:26:34 -0600
committerBrian <[email protected]>2007-10-30 18:26:34 -0600
commitfb9cf48259a4534219c7b8dff5ceaed7afde56ad (patch)
tree4926baf109f3af6e862a671148ecea806a6e31af /src/mesa/shader
parentc1b2b97b8a7f2c9ff0f19c5bba352dfae11de4b2 (diff)
fix InputsRead bug in _mesa_combine_programs()
Diffstat (limited to 'src/mesa/shader')
-rw-r--r--src/mesa/shader/program.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c
index 2d8b8877915..ed1aacd068d 100644
--- a/src/mesa/shader/program.c
+++ b/src/mesa/shader/program.c
@@ -469,6 +469,7 @@ _mesa_combine_programs(GLcontext *ctx,
const GLuint lenB = progB->NumInstructions;
const GLuint numParamsA = _mesa_num_parameters(progA->Parameters);
const GLuint newLength = lenA + lenB;
+ GLbitfield inputsB;
GLuint i;
ASSERT(progA->Target == progB->Target);
@@ -498,8 +499,11 @@ _mesa_combine_programs(GLcontext *ctx,
PROGRAM_OUTPUT, FRAG_RESULT_COLR);
}
- newProg->InputsRead = progA->InputsRead;
- newProg->InputsRead |= (progB->InputsRead & ~(1 << FRAG_ATTRIB_COL0));
+ inputsB = progB->InputsRead;
+ if (progA->OutputsWritten & (1 << FRAG_RESULT_COLR)) {
+ inputsB &= ~(1 << FRAG_ATTRIB_COL0);
+ }
+ newProg->InputsRead = progA->InputsRead | inputsB;
newProg->OutputsWritten = progB->OutputsWritten;
}
else {