brw: constant fold u2u16 conversion on MCS messages

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: bddfbe7fb1 ("brw/blorp: lower MCS fetching in NIR")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
(cherry picked from commit f48c9c3a37)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38010>
This commit is contained in:
Lionel Landwerlin 2025-10-20 22:39:02 +03:00 committed by Dylan Baker
parent 847ad886d6
commit f656d062e3
2 changed files with 6 additions and 2 deletions

View file

@ -934,7 +934,7 @@
"description": "brw: constant fold u2u16 conversion on MCS messages",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "bddfbe7fb1e3d8fe947beefdf6d260d13ddefe2a",
"notes": null

View file

@ -2181,7 +2181,11 @@ brw_postprocess_nir_opts(nir_shader *nir, const struct brw_compiler *compiler,
if (OPT(nir_lower_tex, &tex_options))
OPT(nir_lower_tex, &tex_options);
OPT(brw_nir_lower_mcs_fetch, devinfo);
/* MCS lowering can introduce u2u16 conversions. We need to lower those to
* make constant offsets detectable by brw_nir_texture_backend_opcode().
*/
if (OPT(brw_nir_lower_mcs_fetch, devinfo))
OPT(nir_opt_constant_folding);
const struct brw_nir_lower_texture_opts brw_tex_options = {
.combined_lod_and_array_index = compiler->devinfo->ver >= 20,