From 3dedf9bbc19ca79ce53bf32a1e9a83f8c69279d1 Mon Sep 17 00:00:00 2001 From: Mel Henning Date: Wed, 21 May 2025 20:37:52 -0400 Subject: [PATCH] nak: Fix a perf regression in tex lowering These lines look like they were mistakenly introduced, and cause a significant perf hit. Eg. this fix improves the Horizon Zero Dawn in-game benchamark by ~42% on my ampere machine (5992 pts -> 8517 pts). Fixes: d16e75e55f3 ("nak: Lower texture inputs for Kepler B") Reviewed-by: Faith Ekstrand Part-of: (cherry picked from commit 9d620fabd2b8dc4f6328197ea7f105139ac1e396) --- .pick_status.json | 2 +- src/nouveau/compiler/nak_nir_lower_tex.c | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 9ac6855f32b..29a322c1572 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -4644,7 +4644,7 @@ "description": "nak: Fix a perf regression in tex lowering", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "d16e75e55f3d1c53a5441daf0931668bd3919fa9", "notes": null diff --git a/src/nouveau/compiler/nak_nir_lower_tex.c b/src/nouveau/compiler/nak_nir_lower_tex.c index da8b368392d..98fbc409a6e 100644 --- a/src/nouveau/compiler/nak_nir_lower_tex.c +++ b/src/nouveau/compiler/nak_nir_lower_tex.c @@ -231,8 +231,6 @@ lower_tex(nir_builder *b, nir_tex_instr *tex, const struct nak_compiler *nak) nir_src_rewrite(&tex->src[0].src, nir_vec(b, src0, src0_comps)); if (src1_comps > 0) { - while (src1_comps < 4) - PUSH(src1, nir_undef(b, 1, 32)); num_backend_srcs = 2; tex->src[1].src_type = nir_tex_src_backend2; nir_src_rewrite(&tex->src[1].src, nir_vec(b, src1, src1_comps));