Module: Mesa
Branch: mesa_7_7_branch
Commit: 8ce99c85e7cf2a3c3e8aec2df090abee7ee270ca
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8ce99c85e7cf2a3c3e8aec2df090abee7ee270ca

Author: Eric Anholt <[email protected]>
Date:   Sat Jan  9 02:03:13 2010 -0800

i965: Fix loads of non-relative-addr constants after a reladdr load.

Fixes piglit vp-arl-constant-array-huge-overwritten.
(cherry picked from commit d5b964234c37673ec6b444d0a8fa3b823f03fd05)

---

 src/mesa/drivers/dri/i965/brw_vs_emit.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_vs_emit.c 
b/src/mesa/drivers/dri/i965/brw_vs_emit.c
index 27aac8b..e6ff9f1 100644
--- a/src/mesa/drivers/dri/i965/brw_vs_emit.c
+++ b/src/mesa/drivers/dri/i965/brw_vs_emit.c
@@ -770,7 +770,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",

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to