summaryrefslogtreecommitdiff
path: root/src/glsl/ast_to_hir.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl/ast_to_hir.cpp')
-rw-r--r--src/glsl/ast_to_hir.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index b60bb2f0a0..8e4c3299aa 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -1258,6 +1258,11 @@ ast_expression::hir(exec_list *instructions,
}
} else if (array->type->array_size() == 0) {
_mesa_glsl_error(&loc, state, "unsized array index must be constant");
+ } else {
+ if (array->type->is_array()) {
+ ir_variable *v = array->whole_variable_referenced();
+ v->max_array_access = array->type->array_size();
+ }
}
if (error_emitted)