From 38b59a9e1501ade65b6c4e5e7d556ebccf90f377 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 26 May 2022 14:19:15 -0400 Subject: [PATCH] st/pbo_compute: fix z coords for compute pbos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit without manually taking the value from the global_id vec, this will end up being offset.y again, which breaks z-indexing Fixes: e7b95619596 ("gallium: implement compute pbo download") Reviewed-by: Jason Ekstrand Reviewed-by: Marek Olšák Part-of: --- .pick_status.json | 2 +- src/mesa/state_tracker/st_pbo_compute.c | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index d13134602b7..c4f97bafbab 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -643,7 +643,7 @@ "description": "st/pbo_compute: fix z coords for compute pbos", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 3, "main_sha": null, "because_sha": "e7b95619596167025d26f07efb04dc5bfd5e9aee" }, diff --git a/src/mesa/state_tracker/st_pbo_compute.c b/src/mesa/state_tracker/st_pbo_compute.c index 14f100bd27a..cdb4a45d52d 100644 --- a/src/mesa/state_tracker/st_pbo_compute.c +++ b/src/mesa/state_tracker/st_pbo_compute.c @@ -620,10 +620,19 @@ create_conversion_shader(struct st_context *st, enum pipe_texture_target target, nir_ssa_def *iid = nir_load_local_invocation_id(&b); nir_ssa_def *tile = nir_imul(&b, wid, bsize); nir_ssa_def *global_id = nir_iadd(&b, tile, iid); - nir_ssa_def *start = nir_iadd(&b, global_id, sd.offset); + nir_ssa_def *start = nir_iadd(&b, nir_trim_vector(&b, global_id, 2), sd.offset); - nir_ssa_def *coord = nir_channels(&b, start, (1<is_array = glsl_sampler_type_is_array(sampler->type);