summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/ast_array_index.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/glsl/ast_array_index.cpp')
-rw-r--r--src/compiler/glsl/ast_array_index.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/compiler/glsl/ast_array_index.cpp b/src/compiler/glsl/ast_array_index.cpp
index f6b7a64a281..efddbed6ea3 100644
--- a/src/compiler/glsl/ast_array_index.cpp
+++ b/src/compiler/glsl/ast_array_index.cpp
@@ -88,23 +88,23 @@ update_max_array_access(ir_rvalue *ir, int idx, YYLTYPE *loc,
if (deref_var != NULL) {
if (deref_var->var->is_interface_instance()) {
- unsigned field_index =
- deref_record->record->type->field_index(deref_record->field);
- assert(field_index < deref_var->var->get_interface_type()->length);
+ unsigned field_idx = deref_record->field_idx;
+ assert(field_idx < deref_var->var->get_interface_type()->length);
int *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;
+ if (idx > max_ifc_array_access[field_idx]) {
+ max_ifc_array_access[field_idx] = idx;
/* Check whether this access will, as a side effect, implicitly
* cause the size of a built-in array to be too large.
*/
- check_builtin_array_max_size(deref_record->field, idx+1, *loc,
- state);
+ const char *field_name =
+ deref_record->record->type->fields.structure[field_idx].name;
+ check_builtin_array_max_size(field_name, idx+1, *loc, state);
}
}
}