From: Jason Ekstrand Date: Tue, 12 Jan 2016 01:45:24 +0000 (-0800) Subject: nir/spirv: Allow base derefs in get_vulkan_resource_index X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=350bbd3d15ff5ac3280129dca2cbcf3e4ca6e195;p=mesa.git nir/spirv: Allow base derefs in get_vulkan_resource_index --- diff --git a/src/glsl/nir/spirv/spirv_to_nir.c b/src/glsl/nir/spirv/spirv_to_nir.c index ade3fd4019c..ccdc248f708 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);