From 1a9c7f8c8a0cd75b6f3afbdc60f10088c0157e10 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Sat, 8 Nov 2025 15:56:38 -0500 Subject: [PATCH] panvk: Only lower outputs to temporaries We need to lower outputs to get rid of output reads and so that we can fix up layer writes on Bifrost. However, there's really no point in lowering reads besides moving them to the top. Even then, NIR can probably copy propagate the copies and we'll end up reading straight from the input variable anyway. Reviewed-by: Lars-Ivar Hesselberg Simonsen Reviewed-by: Christoph Pillmayer Part-of: --- src/panfrost/vulkan/panvk_vX_shader.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/panfrost/vulkan/panvk_vX_shader.c b/src/panfrost/vulkan/panvk_vX_shader.c index 7798e672ee9..c7f440e96eb 100644 --- a/src/panfrost/vulkan/panvk_vX_shader.c +++ b/src/panfrost/vulkan/panvk_vX_shader.c @@ -398,12 +398,13 @@ panvk_preprocess_nir(struct vk_physical_device *vk_pdev, if (nir->info.stage == MESA_SHADER_FRAGMENT) NIR_PASS(_, nir, nir_opt_vectorize_io_vars, nir_var_shader_out); - NIR_PASS(_, nir, nir_lower_io_vars_to_temporaries, nir_shader_get_entrypoint(nir), - true, true); + NIR_PASS(_, nir, nir_lower_io_vars_to_temporaries, + nir_shader_get_entrypoint(nir), true, false); #if PAN_ARCH < 9 /* This needs to be done just after the io_to_temporaries pass, because we - * rely on in/out temporaries to collect the final layer_id value. */ + * rely on out temporaries to collect the final layer_id value. + */ NIR_PASS(_, nir, lower_layer_writes); #endif