From 9b1e4bab6bb3be7a5dad910b10a28db0a4bb8b5f Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Mon, 1 Apr 2019 21:31:26 -0500 Subject: nir/builder: Add a nir_imm_zero helper v2: replace nir_zero_vec with nir_imm_zero (Karol Herbst) Reviewed-by: Karol Herbst --- src/compiler/nir/nir_lower_io.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/compiler/nir/nir_lower_io.c') diff --git a/src/compiler/nir/nir_lower_io.c b/src/compiler/nir/nir_lower_io.c index 331ecc08324..c666fe16f7b 100644 --- a/src/compiler/nir/nir_lower_io.c +++ b/src/compiler/nir/nir_lower_io.c @@ -754,10 +754,8 @@ build_explicit_io_load(nir_builder *b, nir_intrinsic_instr *intrin, * as to what we can do with an OOB read. Unfortunately, returning * undefined values isn't one of them so we return an actual zero. */ - nir_const_value zero_val; - memset(&zero_val, 0, sizeof(zero_val)); - nir_ssa_def *zero = nir_build_imm(b, load->num_components, - load->dest.ssa.bit_size, zero_val); + nir_ssa_def *zero = nir_imm_zero(b, load->num_components, + load->dest.ssa.bit_size); const unsigned load_size = (load->dest.ssa.bit_size / 8) * load->num_components; -- cgit v1.2.3