From: Jason Ekstrand Date: Tue, 12 Jan 2016 01:45:52 +0000 (-0800) Subject: nir/spirv: Allow creating local/global variables from interface types X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b208620fd;p=mesa.git nir/spirv: Allow creating local/global variables from interface types Not sure if this is actually allowed, but it's not that hard to just strip the interface information from the type. --- diff --git a/src/glsl/nir/spirv/spirv_to_nir.c b/src/glsl/nir/spirv/spirv_to_nir.c index ccdc248f708..edf44f2849d 100644 --- a/src/glsl/nir/spirv/spirv_to_nir.c +++ b/src/glsl/nir/spirv/spirv_to_nir.c @@ -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) {