spirv: Add and use vtn_type_without_array() helper
[mesa.git] / src / compiler / spirv / spirv_to_nir.c
index 8bfc38cd6a363364e2fcec3b3c9d6ec0b438b4a0..7072f8a3fc3c8f2c95ff813227be992f314e20c2 100644 (file)
@@ -648,6 +648,14 @@ vtn_types_compatible(struct vtn_builder *b,
    vtn_fail("Invalid base type");
 }
 
+struct vtn_type *
+vtn_type_without_array(struct vtn_type *type)
+{
+   while (type->base_type == vtn_base_type_array)
+      type = type->array_element;
+   return type;
+}
+
 /* does a shallow copy of a vtn_type */
 
 static struct vtn_type *