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

2017-12-06 Thread Kenneth Graunke
On Wednesday, December 6, 2017 4:57:05 PM PST Timothy Arceri wrote:
> This fixes a crash in:
> 
> KHR-GL45.enhanced_layouts.xfb_block_stride
> 
> Fixes: 0822517936d4 "glsl: add helper to process xfb qualifiers during 
> linking"
> Cc: Kenneth Graunke 

Thanks a ton for fixing this, Tim!

Reviewed-by: Kenneth Graunke 


signature.asc
Description: This is a digitally signed message part.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


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

2017-12-06 Thread Timothy Arceri
This fixes a crash in:

KHR-GL45.enhanced_layouts.xfb_block_stride

Fixes: 0822517936d4 "glsl: add helper to process xfb qualifiers during linking"
Cc: Kenneth Graunke 
---
 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 0f53cd4aa95..2be81b3f93a 100644
--- a/src/compiler/glsl/link_varyings.cpp
+++ b/src/compiler/glsl/link_varyings.cpp
@@ -158,24 +158,26 @@ process_xfb_layout_qualifiers(void *mem_ctx, const 
gl_linked_shader *sh,
   ir_variable *var = node->as_variable();
   if (!var || var->data.mode != ir_var_shader_out)
  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 */
+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;
 name = ralloc_strdup(NULL, var->name);
  }
  create_xfb_varying_names(mem_ctx, type, , strlen(name), ,
   var->name, member_type, varying_names);
  ralloc_free(name);
   }
}
-- 
2.14.3

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev