From 350bbd3d15ff5ac3280129dca2cbcf3e4ca6e195 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Mon, 11 Jan 2016 17:45:24 -0800 Subject: [PATCH] nir/spirv: Allow base derefs in get_vulkan_resource_index --- src/glsl/nir/spirv/spirv_to_nir.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/glsl/nir/spirv/spirv_to_nir.c b/src/glsl/nir/spirv/spirv_to_nir.c index ade3fd4..ccdc248 100644 --- a/src/glsl/nir/spirv/spirv_to_nir.c +++ b/src/glsl/nir/spirv/spirv_to_nir.c @@ -1254,10 +1254,9 @@ get_vulkan_resource_index(struct vtn_builder *b, nir_variable *var = nir_deref_as_var(*deref)->var; assert(var->interface_type && "variable is a block"); - assert((*deref)->child); nir_ssa_def *array_index; - if ((*deref)->child->deref_type == nir_deref_type_array) { + if ((*deref)->child && (*deref)->child->deref_type == nir_deref_type_array) { *deref = (*deref)->child; *type = (*type)->array_element; array_index = deref_array_offset(b, *deref); -- 2.7.4