From 2e6281ea3426934054c044b58e3ce320b2a4d482 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Sat, 5 Apr 2025 23:05:36 +0300 Subject: [PATCH] brw: fix shuffle with scalar/uniform index The fixes commit isn't actually the source of the bug but likely the biggest enabler because it creates scalar values that more easily end up in the shuffle operations. Signed-off-by: Lionel Landwerlin Fixes: 1b24612c57 ("brw/nir: Treat load_*_uniform_block_intel as convergent") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12927 Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12688 Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12570 Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12905 Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12734 Reviewed-by: Sushma Venkatesh Reddy Reviewed-by: Ian Romanick Part-of: (cherry picked from commit 19e4dda9a2add2ff98b201cc30993cf61df4ed55) --- .pick_status.json | 2 +- src/intel/compiler/brw_generator.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index f498e87b4a7..45c5b49616d 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -634,7 +634,7 @@ "description": "brw: fix shuffle with scalar/uniform index", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "1b24612c570727a0c637159eeebbd88e79715435", "notes": null diff --git a/src/intel/compiler/brw_generator.cpp b/src/intel/compiler/brw_generator.cpp index b307882ecc9..a38293b18fe 100644 --- a/src/intel/compiler/brw_generator.cpp +++ b/src/intel/compiler/brw_generator.cpp @@ -379,7 +379,8 @@ brw_generator::generate_shuffle(fs_inst *inst, /* We use VxH indirect addressing, clobbering a0.0 through a0.7. */ struct brw_reg addr = vec8(brw_address_reg(0)); - struct brw_reg group_idx = suboffset(idx, group); + struct brw_reg group_idx = idx.is_scalar || is_uniform(idx) ? + component(idx, 0) : suboffset(idx, group); if (lower_width == 8 && group_idx.width == BRW_WIDTH_16) { /* Things get grumpy if the register is too wide. */