From 182950ceaf9034e0f6f6e641784af2641d8d178f Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Wed, 28 Jun 2017 02:50:33 -0700 Subject: nir/spirv: Add a helper for pushing SSA values Reviewed-by: Iago Toral Quiroga --- src/compiler/spirv/vtn_variables.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/compiler/spirv/vtn_variables.c') diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c index a9ba39247c8..a9e2dbfaa04 100644 --- a/src/compiler/spirv/vtn_variables.c +++ b/src/compiler/spirv/vtn_variables.c @@ -1774,6 +1774,8 @@ vtn_handle_variables(struct vtn_builder *b, SpvOp opcode, } case SpvOpLoad: { + struct vtn_type *res_type = + vtn_value(b, w[1], vtn_value_type_type)->type; struct vtn_pointer *src = vtn_value(b, w[3], vtn_value_type_pointer)->pointer; @@ -1783,8 +1785,7 @@ vtn_handle_variables(struct vtn_builder *b, SpvOp opcode, return; } - struct vtn_value *val = vtn_push_value(b, w[2], vtn_value_type_ssa); - val->ssa = vtn_variable_load(b, src); + vtn_push_ssa(b, w[2], res_type, vtn_variable_load(b, src)); break; } -- cgit v1.2.3