st/pbo_compute: make compute download conditional in shader slightly more readable
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Thu, 26 May 2022 18:52:46 +0000 (14:52 -0400)
committerMarge Bot <emma+marge@anholt.net>
Tue, 31 May 2022 20:05:49 +0000 (20:05 +0000)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16728>

src/mesa/state_tracker/st_pbo_compute.c

index 72faab4..a52233f 100644 (file)
@@ -624,7 +624,7 @@ create_conversion_shader(struct st_context *st, enum pipe_texture_target target,
 
    nir_ssa_def *coord = nir_channels(&b, start, (1<<coord_components)-1);
    nir_ssa_def *max = nir_iadd(&b, sd.offset, sd.range);
-   nir_push_if(&b, nir_ball(&b, nir_ilt(&b, coord, nir_channels(&b, max, (1<<coord_components)-1))));
+   nir_push_if(&b, nir_ball(&b, nir_ilt(&b, coord, nir_trim_vector(&b, max, coord_components))));
    nir_tex_instr *txf = nir_tex_instr_create(b.shader, 3);
    txf->is_array = glsl_sampler_type_is_array(sampler->type);
    txf->op = nir_texop_txf;