summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-04-01 07:35:07 -0600
committerBrian Paul <[email protected]>2009-04-01 07:37:08 -0600
commitf8dd6594bf1d597b883af44e5d724a181c1e2b53 (patch)
treed0cbd4ab0f31550f63093348340ce0a0d7b72652 /src
parent2555bed7fcc6f9ba35e9fb91e84a144621ccc995 (diff)
glsl: fix texgen state variable tokens in emit_statevars()
This fixes broken variable indexing into the gl_Eye/ObjectPlaneS/T/R/Q arrays. See bug 20986.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/shader/slang/slang_builtin.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/mesa/shader/slang/slang_builtin.c b/src/mesa/shader/slang/slang_builtin.c
index 9858a0f7fdc..83e76b77db3 100644
--- a/src/mesa/shader/slang/slang_builtin.c
+++ b/src/mesa/shader/slang/slang_builtin.c
@@ -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 */