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: c6d3fd8c21 ("gallium/ntt: Emit sample index when necessary for image load/store.")

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15825>
(cherry picked from commit 949bc15ea5)

Conflicts:
	src/gallium/auxiliary/nir/nir_to_tgsi.c
This commit is contained in:
Emma Anholt 2022-04-05 10:05:37 -07:00 committed by Dylan Baker
parent 3c0ba49a66
commit 7148f7d003
2 changed files with 2 additions and 2 deletions

View file

@ -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"
},
{

View file

@ -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);
}