From 7148f7d003bb2d62321fef73aa3ff2de9297d4e3 Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Tue, 5 Apr 2022 10:05:37 -0700 Subject: [PATCH] nir_to_tgsi: Fix emitting the sample number for non-array MSAA image access. It's always in .w, rather than being the next component after the x/y/array index. Fixes: c6d3fd8c21e0 ("gallium/ntt: Emit sample index when necessary for image load/store.") Reviewed-by: Gert Wollny Part-of: (cherry picked from commit 949bc15ea510be9ad6d1565fa3dd069c0140950b) Conflicts: src/gallium/auxiliary/nir/nir_to_tgsi.c --- .pick_status.json | 2 +- src/gallium/auxiliary/nir/nir_to_tgsi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index df57e8c9366..2b4604011a6 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -3452,7 +3452,7 @@ "description": "nir_to_tgsi: Fix emitting the sample number for non-array MSAA image access.", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "because_sha": "c6d3fd8c21e06086e573be24ef3e28454245845f" }, { diff --git a/src/gallium/auxiliary/nir/nir_to_tgsi.c b/src/gallium/auxiliary/nir/nir_to_tgsi.c index b2527a3e70b..ddd6dcdf7da 100644 --- a/src/gallium/auxiliary/nir/nir_to_tgsi.c +++ b/src/gallium/auxiliary/nir/nir_to_tgsi.c @@ -1592,7 +1592,7 @@ ntt_emit_image_load_store(struct ntt_compile *c, nir_intrinsic_instr *instr) if (dim == GLSL_SAMPLER_DIM_MS) { temp = ureg_DECL_temporary(c->ureg); ureg_MOV(c->ureg, temp, coord); - ureg_MOV(c->ureg, ureg_writemask(temp, 1 << (is_array ? 3 : 2)), + ureg_MOV(c->ureg, ureg_writemask(temp, TGSI_WRITEMASK_W), ureg_scalar(ntt_get_src(c, instr->src[2]), TGSI_SWIZZLE_X)); coord = ureg_src(temp); }