diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2008-11-05 14:03:15 -0700 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2008-11-05 14:03:15 -0700 |
commit | 0331c1c1697f32595fd325fcedf0b0703405560b (patch) | |
tree | 1cb4e538548af1be3c5a22545d86ce9901d9f55d /src/mesa/shader/slang/slang_codegen.c | |
parent | f0debbb0bb951bfc6dc0ae467564b3b1230324cf (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.c | 2 |
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) { |