glsl: fix texgen state variable tokens in emit_statevars()
authorBrian Paul <brianp@vmware.com>
Wed, 1 Apr 2009 13:35:07 +0000 (07:35 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 1 Apr 2009 13:37:08 +0000 (07:37 -0600)
This fixes broken variable indexing into the gl_Eye/ObjectPlaneS/T/R/Q arrays.
See bug 20986.

src/mesa/shader/slang/slang_builtin.c

index 9858a0f7fdc010015c24bb507d8c17c439ba259c..83e76b77db337ca5d8e5ad912c95847b8c427b03 100644 (file)
@@ -457,28 +457,36 @@ emit_statevars(const char *name, int array_len,
          tokens[0] = STATE_TEXENV_COLOR;
       }
       else if (strcmp(name, "gl_EyePlaneS") == 0) {
-         tokens[0] = STATE_TEXGEN_EYE_S;
+         tokens[0] = STATE_TEXGEN;
+         tokens[2] = STATE_TEXGEN_EYE_S;
       }
       else if (strcmp(name, "gl_EyePlaneT") == 0) {
-         tokens[0] = STATE_TEXGEN_EYE_T;
+         tokens[0] = STATE_TEXGEN;
+         tokens[2] = STATE_TEXGEN_EYE_T;
       }
       else if (strcmp(name, "gl_EyePlaneR") == 0) {
-         tokens[0] = STATE_TEXGEN_EYE_R;
+         tokens[0] = STATE_TEXGEN;
+         tokens[2] = STATE_TEXGEN_EYE_R;
       }
       else if (strcmp(name, "gl_EyePlaneQ") == 0) {
-         tokens[0] = STATE_TEXGEN_EYE_Q;
+         tokens[0] = STATE_TEXGEN;
+         tokens[2] = STATE_TEXGEN_EYE_Q;
       }
       else if (strcmp(name, "gl_ObjectPlaneS") == 0) {
-         tokens[0] = STATE_TEXGEN_OBJECT_S;
+         tokens[0] = STATE_TEXGEN;
+         tokens[2] = STATE_TEXGEN_OBJECT_S;
       }
       else if (strcmp(name, "gl_ObjectPlaneT") == 0) {
-         tokens[0] = STATE_TEXGEN_OBJECT_T;
+         tokens[0] = STATE_TEXGEN;
+         tokens[2] = STATE_TEXGEN_OBJECT_T;
       }
       else if (strcmp(name, "gl_ObjectPlaneR") == 0) {
-         tokens[0] = STATE_TEXGEN_OBJECT_R;
+         tokens[0] = STATE_TEXGEN;
+         tokens[2] = STATE_TEXGEN_OBJECT_R;
       }
       else if (strcmp(name, "gl_ObjectPlaneQ") == 0) {
-         tokens[0] = STATE_TEXGEN_OBJECT_Q;
+         tokens[0] = STATE_TEXGEN;
+         tokens[2] = STATE_TEXGEN_OBJECT_Q;
       }
       else {
          return -1; /* invalid array name */