summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_lower_io.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2019-04-01 21:31:26 -0500
committerKarol Herbst <[email protected]>2019-04-14 22:25:56 +0200
commit9b1e4bab6bb3be7a5dad910b10a28db0a4bb8b5f (patch)
treec0a17e60f0f182dfcace2f4ac315a4074447049a /src/compiler/nir/nir_lower_io.c
parentdaaf777376303077f9fd4c72e602b8892fe1caaf (diff)
nir/builder: Add a nir_imm_zero helper
v2: replace nir_zero_vec with nir_imm_zero (Karol Herbst) Reviewed-by: Karol Herbst <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_lower_io.c')
-rw-r--r--src/compiler/nir/nir_lower_io.c6
1 files changed, 2 insertions, 4 deletions
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;