summaryrefslogtreecommitdiffstats
path: root/src/compiler/spirv/vtn_cfg.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-06-28 00:45:36 -0700
committerJason Ekstrand <[email protected]>2017-07-18 09:43:12 -0700
commitf2fe74a462ea6e019678c89632a99d8037a2f153 (patch)
tree32b5700a74780003cdf1df6db6f00d8f1e748ce5 /src/compiler/spirv/vtn_cfg.c
parent182950ceaf9034e0f6f6e641784af2641d8d178f (diff)
nir/spirv: Add support for SPV_KHR_variable_pointers
Reviewed-by: Iago Toral Quiroga <[email protected]>
Diffstat (limited to 'src/compiler/spirv/vtn_cfg.c')
-rw-r--r--src/compiler/spirv/vtn_cfg.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/compiler/spirv/vtn_cfg.c b/src/compiler/spirv/vtn_cfg.c
index c81a62d7a8e..03c452cb31a 100644
--- a/src/compiler/spirv/vtn_cfg.c
+++ b/src/compiler/spirv/vtn_cfg.c
@@ -52,7 +52,8 @@ vtn_cfg_handle_prepass_instruction(struct vtn_builder *b, SpvOp opcode,
func->num_params = func_type->length;
func->params = ralloc_array(b->shader, nir_parameter, func->num_params);
for (unsigned i = 0; i < func->num_params; i++) {
- if (func_type->params[i]->base_type == vtn_base_type_pointer) {
+ if (func_type->params[i]->base_type == vtn_base_type_pointer &&
+ func_type->params[i]->type == NULL) {
func->params[i].type = func_type->params[i]->deref->type;
} else {
func->params[i].type = func_type->params[i]->type;
@@ -82,7 +83,7 @@ vtn_cfg_handle_prepass_instruction(struct vtn_builder *b, SpvOp opcode,
assert(b->func_param_idx < b->func->impl->num_params);
nir_variable *param = b->func->impl->params[b->func_param_idx++];
- if (type->base_type == vtn_base_type_pointer) {
+ if (type->base_type == vtn_base_type_pointer && type->type == NULL) {
struct vtn_variable *vtn_var = rzalloc(b, struct vtn_variable);
vtn_var->type = type->deref;
vtn_var->var = param;