nir/builder: Add a nir_imm_true/false helpers

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
Jason Ekstrand
2018-10-19 09:35:49 -05:00
parent 249e32ab17
commit ff45649bc2
8 changed files with 37 additions and 14 deletions
@@ -123,7 +123,7 @@ image_coord_is_in_bounds(nir_builder *b, nir_deref_instr *deref,
nir_ssa_def *cmp = nir_ilt(b, coord, size);
unsigned coord_comps = glsl_get_sampler_coordinate_components(deref->type);
nir_ssa_def *in_bounds = nir_imm_int(b, NIR_TRUE);
nir_ssa_def *in_bounds = nir_imm_true(b);
for (unsigned i = 0; i < coord_comps; i++)
in_bounds = nir_iand(b, in_bounds, nir_channel(b, cmp, i));