From a4a59a2504b82844e26a40417df9e5f04d2b4f96 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Wed, 21 May 2025 15:29:57 +0200 Subject: [PATCH] radv: eliminate useless mov(const) after lowering all IO to scalar This eliminates useless mov copies introduced by nir_lower_io_to_scalar and this might be useful for nir_opt_varyings which optimizes constant varyings. It also uncovers a bug with mesh shader and constant varyaings that is fixed by https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35081. No fossils-db change on NAV21. Signed-off-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_pipeline_graphics.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/amd/vulkan/radv_pipeline_graphics.c b/src/amd/vulkan/radv_pipeline_graphics.c index 16604229293..c23a8323ebd 100644 --- a/src/amd/vulkan/radv_pipeline_graphics.c +++ b/src/amd/vulkan/radv_pipeline_graphics.c @@ -1588,6 +1588,7 @@ radv_graphics_shaders_link_varyings(struct radv_shader_stage *stages) /* Eliminate useless vec->mov copies resulting from scalarization. */ NIR_PASS(_, producer, nir_copy_prop); + NIR_PASS(_, producer, nir_opt_constant_folding); } int highest_changed_producer = -1;