nir/spirv: Allow creating local/global variables from interface types
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 12 Jan 2016 01:45:52 +0000 (17:45 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 12 Jan 2016 01:45:54 +0000 (17:45 -0800)
Not sure if this is actually allowed, but it's not that hard to just strip
the interface information from the type.

src/glsl/nir/spirv/spirv_to_nir.c

index ccdc248..edf44f2 100644 (file)
@@ -1740,9 +1740,11 @@ vtn_handle_variables(struct vtn_builder *b, SpvOp opcode,
          break;
       case SpvStorageClassPrivate:
          var->data.mode = nir_var_global;
+         var->interface_type = NULL;
          break;
       case SpvStorageClassFunction:
          var->data.mode = nir_var_local;
+         var->interface_type = NULL;
          break;
       case SpvStorageClassWorkgroup:
       case SpvStorageClassCrossWorkgroup:
@@ -1798,7 +1800,7 @@ vtn_handle_variables(struct vtn_builder *b, SpvOp opcode,
       /* Interface block variables aren't actually going to be referenced
        * by the generated NIR, so we don't put them in the list
        */
-      if (interface_type && glsl_type_is_struct(interface_type->type))
+      if (var->interface_type)
          break;
 
       if (var->data.mode == nir_var_local) {