i965: Fix loads of non-relative-addr constants after a reladdr load.
authorEric Anholt <eric@anholt.net>
Sat, 9 Jan 2010 10:03:13 +0000 (02:03 -0800)
committerEric Anholt <eric@anholt.net>
Mon, 18 Jan 2010 21:52:47 +0000 (13:52 -0800)
Fixes piglit vp-arl-constant-array-huge-overwritten.

src/mesa/drivers/dri/i965/brw_vs_emit.c

index 1b84dd505f60be1e057bb7c6d6519d983b365041..59334c9ebbe1aa2bba6f34215a790dc13c6fdd5f 100644 (file)
@@ -771,7 +771,13 @@ get_constant(struct brw_vs_compile *c,
    if (c->current_const[argIndex].index != src->Index || relAddr) {
       struct brw_reg addrReg = c->regs[PROGRAM_ADDRESS][0];
 
-      c->current_const[argIndex].index = src->Index;
+      /* If using a non-relative-addressed constant, then keep track of it for
+       * later use without reloading.
+       */
+      if (relAddr)
+        c->current_const[argIndex].index = -1;
+      else
+        c->current_const[argIndex].index = src->Index;
 
 #if 0
       printf("  fetch const[%d] for arg %d into reg %d\n",