summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-01-06 08:45:53 -0700
committerBrian Paul <brianp@vmware.com>2009-01-06 08:45:53 -0700
commited8f857792d3ea9737359d098e36aed28a6adfac (patch)
treeadddb1641c0d71df41125edef24f52d8f30fc001 /src/mesa
parent5b66bc1a83a9c5745e0448cb6c05ee27d7ce858b (diff)
mesa: fix accidental regression in GLSL built-in texture matrix lookup
Was broken by commit 9aca9a4b72b2a7b378e50bd88f9c3324d07375ec. (cherry picked from commit fe984aed5a9ee7c6e000d48a0a584b964fefa848) Conflicts: src/mesa/shader/slang/slang_builtin.c
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/shader/slang/slang_builtin.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mesa/shader/slang/slang_builtin.c b/src/mesa/shader/slang/slang_builtin.c
index cde44c0b99..db00c54b8a 100644
--- a/src/mesa/shader/slang/slang_builtin.c
+++ b/src/mesa/shader/slang/slang_builtin.c
@@ -107,10 +107,14 @@ lookup_statevar(const char *var, GLint index1, GLint index2, const char *field,
if (isMatrix) {
if (tokens[0] == STATE_TEXTURE_MATRIX) {
if (index1 >= 0) {
- tokens[1] = index1;
+ tokens[1] = index1; /* which texture matrix */
index1 = 0; /* prevent extra addition at end of function */
}
}
+ if (index1 < 0) {
+ /* index1 is unused: prevent extra addition at end of function */
+ index1 = 0;
+ }
}
else if (strcmp(var, "gl_DepthRange") == 0) {
tokens[0] = STATE_DEPTH_RANGE;