summaryrefslogtreecommitdiff
path: root/src/mesa/shader/slang/slang_codegen.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-11-05 14:03:15 -0700
committerBrian Paul <brian.paul@tungstengraphics.com>2008-11-05 16:02:16 -0700
commit50beb4e6fd2e06d6007c69899111f6a22319a4d8 (patch)
tree418482cbd0a1ad8d9bd27925b4725466f025d56c /src/mesa/shader/slang/slang_codegen.c
parentdea4826b8481d7328e52dbaa2eb43fd861d73e79 (diff)
mesa: fix a GLSL array indexing codegen bug
Expressions like array[i] + array[j] didn't work properly before.
Diffstat (limited to 'src/mesa/shader/slang/slang_codegen.c')
-rw-r--r--src/mesa/shader/slang/slang_codegen.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c
index e7b2bad8c2..d83e3b01e6 100644
--- a/src/mesa/shader/slang/slang_codegen.c
+++ b/src/mesa/shader/slang/slang_codegen.c
@@ -3253,7 +3253,7 @@ _slang_gen_array_element(slang_assemble_ctx * A, slang_operation *oper)
index = _slang_gen_operation(A, &oper->children[1]);
if (array && index) {
/* bounds check */
- GLint constIndex = 0;
+ GLint constIndex = -1;
if (index->Opcode == IR_FLOAT) {
constIndex = (int) index->Value[0];
if (constIndex < 0 || constIndex >= arrayLen) {