Mesa (mesa_7_7_branch): st/mesa: allow negative index for PROGRAM_STATE_VAR

Brian Paul brianp at kemper.freedesktop.org
Fri Feb 5 21:57:08 UTC 2010


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

Author: Brian Paul <brianp at vmware.com>
Date:   Fri Feb  5 14:53:58 2010 -0700

st/mesa: allow negative index for PROGRAM_STATE_VAR

The piglit vp-address-01 test uses negative address-relative
offsets.  In this test we're indexing into PROGRAM_STATE_VAR
which, in turn, contains references to ENV vars.

We previously fixed this issue for PROGRAM_CONSTANT.

piglit/vp-address-01 (the version from Feb 5) passes now.

---

 src/mesa/state_tracker/st_mesa_to_tgsi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c
index 0b7786c..2c3b866 100644
--- a/src/mesa/state_tracker/st_mesa_to_tgsi.c
+++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c
@@ -172,13 +172,13 @@ src_register( struct st_translate *t,
          t->temps[index] = ureg_DECL_temporary( t->ureg );
       return ureg_src(t->temps[index]);
 
-   case PROGRAM_STATE_VAR:
    case PROGRAM_NAMED_PARAM:
    case PROGRAM_ENV_PARAM:
    case PROGRAM_LOCAL_PARAM:
    case PROGRAM_UNIFORM:
       ASSERT(index >= 0);
       return t->constants[index];
+   case PROGRAM_STATE_VAR:
    case PROGRAM_CONSTANT:       /* ie, immediate */
       if (index < 0)
          return ureg_DECL_constant( t->ureg, 0 );




More information about the mesa-commit mailing list