Mesa (main): st/pbo_compute: make compute download conditional in shader slightly more readable

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue May 31 20:50:35 UTC 2022


Module: Mesa
Branch: main
Commit: 15f37d8d6f9fb6765573dc68a04417af14a41024
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=15f37d8d6f9fb6765573dc68a04417af14a41024

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Thu May 26 14:52:46 2022 -0400

st/pbo_compute: make compute download conditional in shader slightly more readable

Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16728>

---

 src/mesa/state_tracker/st_pbo_compute.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/state_tracker/st_pbo_compute.c b/src/mesa/state_tracker/st_pbo_compute.c
index 72faab4dfc6..a52233f911d 100644
--- a/src/mesa/state_tracker/st_pbo_compute.c
+++ b/src/mesa/state_tracker/st_pbo_compute.c
@@ -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;



More information about the mesa-commit mailing list