anv/apply_dynamic_offsets: Use the right sized immediate zero
authorJason Ekstrand <jason.ekstrand@intel.com>
Sat, 7 Nov 2015 00:49:24 +0000 (16:49 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Sat, 7 Nov 2015 00:49:24 +0000 (16:49 -0800)
src/vulkan/anv_nir_apply_dynamic_offsets.c

index d6c09474da785123bd9bbae843157c921c8ddc52..dd4f5dfe5453cbdd6aaac83d0e543ccadd9f9aaf 100644 (file)
@@ -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);