From 9abef3e81748672a662ebf19ed52b263514c228f Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Thu, 22 Oct 2015 17:28:25 -0700 Subject: [PATCH] nir/spirv: Make get_builtin_variable take a nir_variable_mode We'll want this in a moment for validation but, for now, it just gets stompped by get_builtin_variable. --- src/glsl/nir/spirv_to_nir.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/glsl/nir/spirv_to_nir.c b/src/glsl/nir/spirv_to_nir.c index 52b82e0d674..c8594085d5e 100644 --- a/src/glsl/nir/spirv_to_nir.c +++ b/src/glsl/nir/spirv_to_nir.c @@ -834,6 +834,7 @@ var_decoration_cb(struct vtn_builder *b, struct vtn_value *val, int member, static nir_variable * get_builtin_variable(struct vtn_builder *b, + nir_variable_mode mode, const struct glsl_type *type, SpvBuiltIn builtin) { @@ -841,7 +842,6 @@ get_builtin_variable(struct vtn_builder *b, if (!var) { int location; - nir_variable_mode mode; vtn_get_builtin_location(builtin, &location, &mode); var = nir_variable_create(b->shader, mode, type, "builtin"); @@ -1349,7 +1349,9 @@ vtn_handle_variables(struct vtn_builder *b, SpvOp opcode, /* If we encounter a builtin, we throw away the ress of the * access chain, jump to the builtin, and keep building. */ - nir_variable *builtin = get_builtin_variable(b, deref_type->type, + nir_variable *builtin = get_builtin_variable(b, + base->var->data.mode, + deref_type->type, deref_type->builtin); val->deref = nir_deref_var_create(b, builtin); tail = &val->deref->deref; -- 2.30.2