[Mesa-dev] [PATCH 07/28] spirv/nir: don't set interface_type if it is not a struct
Alejandro PiƱeiro
apinheiro at igalia.com
Mon Oct 22 12:24:29 UTC 2018
vnt_variables uses interface_type on several use cases, but on nir
variable it is more limited. From nir.h:
/**
* For variables that are in an interface block or are an instance of an
* interface block, this is the \c GLSL_TYPE_INTERFACE type for that block.
*
* \sa ir_variable::location
*/
But interface blocks expects the type to be an struct, so those cases
should not be filled. For example, glsl checks if a variable is in an
uniform block if it is an uniform and has an interface type.
One example of why this is needed: gl_PatchVerticesIn is lowered to an
uniform. Without this change, it would include a interface_type. Then,
we would try to initialize the uniform block, and find that it doesn't
have any component.
---
src/compiler/spirv/vtn_variables.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c
index 957ef0610b7..9a4ddeaa822 100644
--- a/src/compiler/spirv/vtn_variables.c
+++ b/src/compiler/spirv/vtn_variables.c
@@ -1818,6 +1818,8 @@ vtn_create_variable(struct vtn_builder *b, struct vtn_value *val,
var->var->members[i].mode = nir_mode;
var->var->members[i].patch = var->patch;
}
+ } else {
+ var->var->interface_type = NULL;
}
/* For inputs and outputs, we need to grab locations and builtin
--
2.14.1
More information about the mesa-dev
mailing list