glsl: get correct member type when processing xfb ifc arrays
authorTimothy Arceri <tarceri@itsqueeze.com>
Wed, 6 Dec 2017 23:16:55 +0000 (10:16 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Thu, 7 Dec 2017 04:22:23 +0000 (15:22 +1100)
This fixes a crash in:

KHR-GL45.enhanced_layouts.xfb_block_stride

Fixes: 0822517936d4 "glsl: add helper to process xfb qualifiers during linking"
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/compiler/glsl/link_varyings.cpp

index 0f53cd4aa950971913f9d1dc97f8c2377331b6ef..2be81b3f93a777ce9133c930811afd049f2623ab 100644 (file)
@@ -165,10 +165,12 @@ process_xfb_layout_qualifiers(void *mem_ctx, const gl_linked_shader *sh,
 
          if (var->data.from_named_ifc_block) {
             type = var->get_interface_type();
+
             /* Find the member type before it was altered by lowering */
+            const glsl_type *type_wa = type->without_array();
             member_type =
-               type->fields.structure[type->field_index(var->name)].type;
-            name = ralloc_strdup(NULL, type->without_array()->name);
+               type_wa->fields.structure[type_wa->field_index(var->name)].type;
+            name = ralloc_strdup(NULL, type_wa->name);
          } else {
             type = var->type;
             member_type = NULL;