summaryrefslogtreecommitdiffstats
path: root/src/glsl/ast_array_index.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl/ast_array_index.cpp')
-rw-r--r--src/glsl/ast_array_index.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/glsl/ast_array_index.cpp b/src/glsl/ast_array_index.cpp
index 5ca85f6ab3f..49a8574f2b8 100644
--- a/src/glsl/ast_array_index.cpp
+++ b/src/glsl/ast_array_index.cpp
@@ -88,8 +88,14 @@ update_max_array_access(ir_rvalue *ir, unsigned idx, YYLTYPE *loc,
unsigned field_index =
deref_record->record->type->field_index(deref_record->field);
assert(field_index < interface_type->length);
- if (idx > deref_var->var->max_ifc_array_access[field_index]) {
- deref_var->var->max_ifc_array_access[field_index] = idx;
+
+ unsigned *const max_ifc_array_access =
+ deref_var->var->get_max_ifc_array_access();
+
+ assert(max_ifc_array_access != NULL);
+
+ if (idx > max_ifc_array_access[field_index]) {
+ max_ifc_array_access[field_index] = idx;
/* Check whether this access will, as a side effect, implicitly
* cause the size of a built-in array to be too large.