From 72ac874ba6d7d4deebdcd5c8ced89d4f3db03ae9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timur=20Krist=C3=B3f?= Date: Thu, 27 Feb 2025 18:57:21 +0100 Subject: [PATCH] radv: Remove radv_remove_varyings. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Not needed anymore, since we are now doing this on lowered I/O. Signed-off-by: Timur Kristóf Reviewed-by: Georg Lehmann Part-of: --- src/amd/vulkan/radv_pipeline_graphics.c | 41 ------------------------- 1 file changed, 41 deletions(-) diff --git a/src/amd/vulkan/radv_pipeline_graphics.c b/src/amd/vulkan/radv_pipeline_graphics.c index fa36ed8ac9b..d56b10c2daa 100644 --- a/src/amd/vulkan/radv_pipeline_graphics.c +++ b/src/amd/vulkan/radv_pipeline_graphics.c @@ -1504,37 +1504,6 @@ radv_pipeline_needs_noop_fs(struct radv_graphics_pipeline *pipeline, const struc return false; } -static void -radv_remove_varyings(nir_shader *nir) -{ - /* We can't demote mesh outputs to nir_var_shader_temp yet, because - * they don't support array derefs of vectors. - */ - if (nir->info.stage == MESA_SHADER_MESH) - return; - - bool fixup_derefs = false; - - nir_foreach_shader_out_variable (var, nir) { - if (var->data.always_active_io) - continue; - - if (var->data.location < VARYING_SLOT_VAR0) - continue; - - nir->info.outputs_written &= ~BITFIELD64_BIT(var->data.location); - var->data.location = 0; - var->data.mode = nir_var_shader_temp; - fixup_derefs = true; - } - - if (fixup_derefs) { - NIR_PASS(_, nir, nir_fixup_deref_modes); - NIR_PASS(_, nir, nir_remove_dead_variables, nir_var_shader_temp, NULL); - NIR_PASS(_, nir, nir_opt_dce); - } -} - static void radv_graphics_shaders_link(const struct radv_device *device, const struct radv_graphics_state_key *gfx_state, struct radv_shader_stage *stages) @@ -2853,16 +2822,6 @@ radv_graphics_shaders_compile(struct radv_device *device, struct vk_pipeline_cac NIR_PASS(_, stages[MESA_SHADER_GEOMETRY].nir, nir_lower_vars_to_ssa); } - /* Remove all varyings when the fragment shader is a noop. */ - if (noop_fs) { - radv_foreach_stage (i, active_nir_stages) { - if (radv_is_last_vgt_stage(&stages[i])) { - radv_remove_varyings(stages[i].nir); - break; - } - } - } - radv_graphics_shaders_link(device, gfx_state, stages); if (stages[MESA_SHADER_FRAGMENT].nir) {