mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
aco: Use aco_shader_info::hw_stage instead of guessing.
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 <timur.kristof@gmail.com> Reviewed-by: Qiang Yu <yuq825@gmail.com> Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23597>
This commit is contained in:
parent
6028c146d5
commit
bc971ba2c7
1 changed files with 1 additions and 45 deletions
|
|
@ -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 = {};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue