i965: init current_const[i].index = -1
authorBrian Paul <brianp@vmware.com>
Thu, 9 Apr 2009 01:29:37 +0000 (19:29 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 9 Apr 2009 01:37:33 +0000 (19:37 -0600)
src/mesa/drivers/dri/i965/brw_wm_glsl.c

index 3d360d58d531eb1c2083c54182344e7144941286..c609256b6f72b4e8f94402c4c8602b0c68aeeac3 100644 (file)
@@ -254,9 +254,10 @@ static void prealloc_reg(struct brw_wm_compile *c)
      * XXX alloc these on demand!
      */
     if (c->use_const_buffer) {
-       c->current_const[0].reg = alloc_tmp(c);
-       c->current_const[1].reg = alloc_tmp(c);
-       c->current_const[2].reg = alloc_tmp(c);
+       for (i = 0; i < 3; i++) {
+          c->current_const[i].index = -1;
+          c->current_const[i].reg = alloc_tmp(c);
+       }
     }
     /*
     printf("USE CONST BUFFER? %d\n", c->use_const_buffer);