From ac45243ec1710c46f9eb4bad2ba7a1f63cf8da8a Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Wed, 28 May 2025 11:28:59 -0400 Subject: [PATCH] nak: Unconditionally call lower_io_to_temporaries in preprocess_nir We're calling it for fragment shaders and NVK is calling it for eerything before invoking NAK so we may as well call it unconditionally in NAK and skip calling it in NVK. Reviewed-by: Lorenzo Rossi Acked-by: Karol Herbst Reviewed-by: Mel Henning Part-of: --- src/nouveau/compiler/nak_nir.c | 7 +++---- src/nouveau/vulkan/nvk_shader.c | 3 --- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/nouveau/compiler/nak_nir.c b/src/nouveau/compiler/nak_nir.c index e6c164d00a9..79b4d6485b7 100644 --- a/src/nouveau/compiler/nak_nir.c +++ b/src/nouveau/compiler/nak_nir.c @@ -299,10 +299,9 @@ nak_preprocess_nir(nir_shader *nir, const struct nak_compiler *nak) nir_validate_ssa_dominance(nir, "before nak_preprocess_nir"); - if (nir->info.stage == MESA_SHADER_FRAGMENT) { - nir_lower_io_to_temporaries(nir, nir_shader_get_entrypoint(nir), - true /* outputs */, false /* inputs */); - } + OPT(nir, nir_lower_io_to_temporaries, + nir_shader_get_entrypoint(nir), + true /* outputs */, false /* inputs */); const nir_lower_tex_options tex_options = { .lower_txd_3d = true, diff --git a/src/nouveau/vulkan/nvk_shader.c b/src/nouveau/vulkan/nvk_shader.c index 6250dcfefb7..20f980efb2e 100644 --- a/src/nouveau/vulkan/nvk_shader.c +++ b/src/nouveau/vulkan/nvk_shader.c @@ -136,9 +136,6 @@ nvk_preprocess_nir(struct vk_physical_device *vk_pdev, const struct nvk_physical_device *pdev = container_of(vk_pdev, struct nvk_physical_device, vk); - NIR_PASS(_, nir, nir_lower_io_to_temporaries, - nir_shader_get_entrypoint(nir), true, false); - nak_preprocess_nir(nir, pdev->nak); }