[Mesa-dev] [PATCH] glsl: get correct member type when processing xfb ifc arrays

Timothy Arceri tarceri at itsqueeze.com
Wed Dec 6 23:34:57 UTC 2017


This fixes a crash (although the test still fails) in release builds
with:

KHR-GL45.enhanced_layouts.xfb_block_stride

Fixes: 0822517936d4 "glsl: add helper to process xfb qualifiers during linking"
Cc: Kenneth Graunke <kenneth at whitecape.org>
---
 src/compiler/glsl/link_varyings.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compiler/glsl/link_varyings.cpp b/src/compiler/glsl/link_varyings.cpp
index 0f53cd4aa95..3f35780b1b4 100644
--- a/src/compiler/glsl/link_varyings.cpp
+++ b/src/compiler/glsl/link_varyings.cpp
@@ -160,21 +160,21 @@ process_xfb_layout_qualifiers(void *mem_ctx, const gl_linked_shader *sh,
          continue;
 
       if (var->data.explicit_xfb_offset) {
          char *name;
          const glsl_type *type, *member_type;
 
          if (var->data.from_named_ifc_block) {
             type = var->get_interface_type();
             /* Find the member type before it was altered by lowering */
             member_type =
-               type->fields.structure[type->field_index(var->name)].type;
+               type->fields.structure[type->without_array()->field_index(var->name)].type;
             name = ralloc_strdup(NULL, type->without_array()->name);
          } else {
             type = var->type;
             member_type = NULL;
             name = ralloc_strdup(NULL, var->name);
          }
          create_xfb_varying_names(mem_ctx, type, &name, strlen(name), &i,
                                   var->name, member_type, varying_names);
          ralloc_free(name);
       }
-- 
2.14.3



More information about the mesa-dev mailing list