st/glsl_to_tgsi: fix getting the image type for array of structs (again)
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 22 Aug 2017 10:34:48 +0000 (12:34 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 22 Aug 2017 11:58:51 +0000 (13:58 +0200)
We want the type of the field, not of the struct.

This fixes a regression in the following piglit test:
arb_bindless_texture/compiler/images/arrays-of-struct.frag

Fixes: 49d9286a3f ("glsl: stop copying struct and interface member names")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/mesa/state_tracker/st_glsl_to_tgsi.cpp

index 221dc10107907b0f8671a22c5ac3e86288e4a7d4..d12434101f3ea02dcd0b0f25740a4089d4ea07a1 100644 (file)
@@ -3764,12 +3764,10 @@ get_image_qualifiers(ir_dereference *ir, const glsl_type **type,
    switch (ir->ir_type) {
    case ir_type_dereference_record: {
       ir_dereference_record *deref_record = ir->as_dereference_record();
-
-      *type = deref_record->type;
-
-      const glsl_type *struct_type =
-         deref_record->record->type->without_array();
+      const glsl_type *struct_type = deref_record->record->type;
       int fild_idx = deref_record->field_idx;
+
+      *type = struct_type->fields.structure[fild_idx].type->without_array();
       *memory_coherent =
          struct_type->fields.structure[fild_idx].memory_coherent;
       *memory_volatile =