From b208620fd240a9d74025cdf1ca1d2a54972ebc55 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Mon, 11 Jan 2016 17:45:52 -0800 Subject: [PATCH] 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. --- src/glsl/nir/spirv/spirv_to_nir.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) { -- 2.30.2