From bc971ba2c7d8cb869f38f069306112bdb75cb7e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timur=20Krist=C3=B3f?= Date: Mon, 12 Jun 2023 15:55:40 +0200 Subject: [PATCH] aco: Use aco_shader_info::hw_stage instead of guessing. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With this change, ACO is going to rely on the caller to set the HW stage and will no longer guess it from the input shaders. This will help enable compiling merged shaders separately, but that will need further changes in instruction selection. Signed-off-by: Timur Kristóf Reviewed-by: Qiang Yu Reviewed-by: Daniel Schürmann Part-of: --- .../aco_instruction_selection_setup.cpp | 46 +------------------ 1 file changed, 1 insertion(+), 45 deletions(-) diff --git a/src/amd/compiler/aco_instruction_selection_setup.cpp b/src/amd/compiler/aco_instruction_selection_setup.cpp index a707bc39010..57247c75cc3 100644 --- a/src/amd/compiler/aco_instruction_selection_setup.cpp +++ b/src/amd/compiler/aco_instruction_selection_setup.cpp @@ -689,51 +689,7 @@ setup_isel_context(Program* program, unsigned shader_count, struct nir_shader* c sw_stage = SWStage::FS; } - bool gfx9_plus = options->gfx_level >= GFX9; - bool ngg = info->is_ngg && options->gfx_level >= GFX10; - ac_hw_stage hw_stage; - if (sw_stage == SWStage::VS && info->vs.as_es && !ngg) - hw_stage = AC_HW_EXPORT_SHADER; - else if (sw_stage == SWStage::VS && !info->vs.as_ls && !ngg) - hw_stage = AC_HW_VERTEX_SHADER; - else if (sw_stage == SWStage::VS && ngg) - hw_stage = AC_HW_NEXT_GEN_GEOMETRY_SHADER; - else if (sw_stage == SWStage::GS) - hw_stage = AC_HW_LEGACY_GEOMETRY_SHADER; - else if (sw_stage == SWStage::FS) - hw_stage = AC_HW_PIXEL_SHADER; - else if (sw_stage == SWStage::CS) - hw_stage = AC_HW_COMPUTE_SHADER; - else if (sw_stage == SWStage::TS) - hw_stage = AC_HW_COMPUTE_SHADER; - else if (sw_stage == SWStage::MS) - hw_stage = AC_HW_NEXT_GEN_GEOMETRY_SHADER; - else if (sw_stage == SWStage::VS_GS && gfx9_plus && !ngg) - hw_stage = AC_HW_LEGACY_GEOMETRY_SHADER; - else if (sw_stage == SWStage::VS_GS && ngg) - hw_stage = AC_HW_NEXT_GEN_GEOMETRY_SHADER; - else if (sw_stage == SWStage::VS && info->vs.as_ls) - hw_stage = AC_HW_LOCAL_SHADER; - else if (sw_stage == SWStage::TCS) - hw_stage = AC_HW_HULL_SHADER; - else if (sw_stage == SWStage::VS_TCS) - hw_stage = AC_HW_HULL_SHADER; - else if (sw_stage == SWStage::TES && !info->tes.as_es && !ngg) - hw_stage = AC_HW_VERTEX_SHADER; - else if (sw_stage == SWStage::TES && !info->tes.as_es && ngg) - hw_stage = AC_HW_NEXT_GEN_GEOMETRY_SHADER; - else if (sw_stage == SWStage::TES && info->tes.as_es && !ngg) - hw_stage = AC_HW_EXPORT_SHADER; - else if (sw_stage == SWStage::TES_GS && gfx9_plus && !ngg) - hw_stage = AC_HW_LEGACY_GEOMETRY_SHADER; - else if (sw_stage == SWStage::TES_GS && ngg) - hw_stage = AC_HW_NEXT_GEN_GEOMETRY_SHADER; - else if (sw_stage == SWStage::RT) - hw_stage = AC_HW_COMPUTE_SHADER; - else - unreachable("Shader stage not implemented"); - - init_program(program, Stage{hw_stage, sw_stage}, info, options->gfx_level, options->family, + init_program(program, Stage{info->hw_stage, sw_stage}, info, options->gfx_level, options->family, options->wgp_mode, config); isel_context ctx = {};