From 046563167ca9a608474a1c582087fdaf54bd9083 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 6 Nov 2015 16:49:24 -0800 Subject: anv/apply_dynamic_offsets: Use the right sized immediate zero --- src/vulkan/anv_nir_apply_dynamic_offsets.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/vulkan') diff --git a/src/vulkan/anv_nir_apply_dynamic_offsets.c b/src/vulkan/anv_nir_apply_dynamic_offsets.c index d6c09474da7..dd4f5dfe545 100644 --- a/src/vulkan/anv_nir_apply_dynamic_offsets.c +++ b/src/vulkan/anv_nir_apply_dynamic_offsets.c @@ -187,10 +187,13 @@ apply_dynamic_offsets_block(nir_block *block, void *void_state) exec_list_push_tail(&phi->srcs, &src1->node); b->cursor = nir_after_cf_list(&if_stmt->else_list); + nir_ssa_def *zero = nir_build_imm(b, intrin->num_components, + (nir_const_value) { .u = { 0, 0, 0, 0 } }); + nir_phi_src *src2 = ralloc(phi, nir_phi_src); struct exec_node *enode = exec_list_get_tail(&if_stmt->else_list); src2->pred = exec_node_data(nir_block, enode, cf_node.node); - src2->src = nir_src_for_ssa(nir_imm_int(b, 0)); + src2->src = nir_src_for_ssa(zero); exec_list_push_tail(&phi->srcs, &src2->node); nir_instr_insert_after_cf(&if_stmt->cf_node, &phi->instr); -- cgit v1.2.3