summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2011-03-24 16:50:23 -0700
committerIan Romanick <[email protected]>2011-03-25 11:28:07 -0700
commit0d9d036004f135c38990c60f46074b70cff6e663 (patch)
treec8bbd53b5efdc7a392283ebcda032b1fd345941d /src
parentbc83f6bd585bba6dee3fa2264d32ab59e9a9c99e (diff)
glsl: Fix off-by-one error setting max_array_access for non-constant indexing
NOTE: This is a candidate for the stable branches.
Diffstat (limited to 'src')
-rw-r--r--src/glsl/ast_to_hir.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index cdb16fd492b..a1c76e834af 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -1577,7 +1577,7 @@ ast_expression::hir(exec_list *instructions,
*/
ir_variable *v = array->whole_variable_referenced();
if (v != NULL)
- v->max_array_access = array->type->array_size();
+ v->max_array_access = array->type->array_size() - 1;
}
}