summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mesa/drivers/dri/i915/i915_fragprog.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c b/src/mesa/drivers/dri/i915/i915_fragprog.c
index 32050cebf33..e1658fc42d4 100644
--- a/src/mesa/drivers/dri/i915/i915_fragprog.c
+++ b/src/mesa/drivers/dri/i915/i915_fragprog.c
@@ -306,8 +306,8 @@ do { \
static bool calc_live_regs( struct i915_fragment_program *p )
{
const struct gl_fragment_program *program = &p->FragProg;
- GLuint regsUsed = 0xffff0000;
- uint8_t live_components[16] = { 0, };
+ GLuint regsUsed = ~((1 << I915_MAX_TEMPORARY) - 1);
+ uint8_t live_components[I915_MAX_TEMPORARY] = { 0, };
GLint i;
for (i = program->Base.NumInstructions - 1; i >= 0; i--) {
@@ -317,7 +317,7 @@ static bool calc_live_regs( struct i915_fragment_program *p )
/* Register is written to: unmark as live for this and preceeding ops */
if (inst->DstReg.File == PROGRAM_TEMPORARY) {
- if (inst->DstReg.Index > 16)
+ if (inst->DstReg.Index >= I915_MAX_TEMPORARY)
return false;
live_components[inst->DstReg.Index] &= ~inst->DstReg.WriteMask;
@@ -330,7 +330,7 @@ static bool calc_live_regs( struct i915_fragment_program *p )
if (inst->SrcReg[a].File == PROGRAM_TEMPORARY) {
unsigned c;
- if (inst->SrcReg[a].Index > 16)
+ if (inst->SrcReg[a].Index >= I915_MAX_TEMPORARY)
return false;
regsUsed |= 1 << inst->SrcReg[a].Index;