diff options
Diffstat (limited to 'src/mesa/shader/slang/slang_builtin.c')
-rw-r--r-- | src/mesa/shader/slang/slang_builtin.c | 6 |
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; |