diff options
Diffstat (limited to 'src/compiler/glsl/lower_buffer_access.cpp')
-rw-r--r-- | src/compiler/glsl/lower_buffer_access.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/compiler/glsl/lower_buffer_access.cpp b/src/compiler/glsl/lower_buffer_access.cpp index 24a96e2fba4..76d366c4b96 100644 --- a/src/compiler/glsl/lower_buffer_access.cpp +++ b/src/compiler/glsl/lower_buffer_access.cpp @@ -252,7 +252,7 @@ lower_buffer_access::is_dereferenced_thing_row_major(const ir_rvalue *deref) ir = record_deref->record; - const int idx = ir->type->field_index(record_deref->field); + const int idx = record_deref->field_idx; assert(idx >= 0); const enum glsl_matrix_layout matrix_layout = @@ -445,8 +445,8 @@ lower_buffer_access::setup_buffer_access(void *mem_ctx, intra_struct_offset = glsl_align(intra_struct_offset, field_align); - if (strcmp(struct_type->fields.structure[i].name, - deref_record->field) == 0) { + assert(deref_record->field_idx >= 0); + if (i == (unsigned) deref_record->field_idx) { if (struct_field) *struct_field = &struct_type->fields.structure[i]; break; |