Mesa (master): glsl: get correct member type when processing xfb ifc arrays

Timothy Arceri tarceri at kemper.freedesktop.org
Thu Dec 7 04:26:38 UTC 2017


Module: Mesa
Branch: master
Commit: 9d53ccccb251d21f9291abaa3a28a41d06ce8c91
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9d53ccccb251d21f9291abaa3a28a41d06ce8c91

Author: Timothy Arceri <tarceri at itsqueeze.com>
Date:   Thu Dec  7 10:16:55 2017 +1100

glsl: get correct member type when processing xfb ifc arrays

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 at whitecape.org>

---

 src/compiler/glsl/link_varyings.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/compiler/glsl/link_varyings.cpp b/src/compiler/glsl/link_varyings.cpp
index 0f53cd4aa9..2be81b3f93 100644
--- a/src/compiler/glsl/link_varyings.cpp
+++ b/src/compiler/glsl/link_varyings.cpp
@@ -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;




More information about the mesa-commit mailing list