nir/spirv: Allow base derefs in get_vulkan_resource_index
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 12 Jan 2016 01:45:24 +0000 (17:45 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 12 Jan 2016 01:45:24 +0000 (17:45 -0800)
src/glsl/nir/spirv/spirv_to_nir.c

index ade3fd4019caafa31a5fb41b0113babfa0bbc964..ccdc248f70869569ba0d58bd6871ceea25248393 100644 (file)
@@ -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);