From 278eaa5ab137463b90dfad0eda559227319784d9 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Mon, 25 Mar 2024 17:32:37 -0500 Subject: [PATCH] nak: Call nir_lower_io_to_temporaries for FS outputs They can't be indirected and we also need the guarantee that all output writes are in the last block in the shader or else our back-end copying is sketchy. Part-of: --- src/nouveau/compiler/nak_nir.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/nouveau/compiler/nak_nir.c b/src/nouveau/compiler/nak_nir.c index 47359781ba3..a7d5a68e38d 100644 --- a/src/nouveau/compiler/nak_nir.c +++ b/src/nouveau/compiler/nak_nir.c @@ -295,6 +295,11 @@ 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 */); + } + const nir_lower_tex_options tex_options = { .lower_txd_3d = true, .lower_txd_cube_map = true,