diff options
author | Samuel Pitoiset <samuel.pitoiset@gmail.com> | 2023-08-21 15:22:05 +0200 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2023-08-23 09:21:33 +0000 |
commit | 203b4054f3a6a2a3edf72f725f42bc4f6fe20b00 (patch) | |
tree | 65e85f65d076550a5f0238476b5776db76a0efe3 /src/amd/compiler/aco_print_ir.cpp | |
parent | 09ff733a3e559eda05686c8e1d22a5d4f7d771a8 (diff) |
aco: rework printing shader stages
To avoid printing "unknown" for shader object when eg. VS and TCS
are compiled separately.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24810>
Diffstat (limited to 'src/amd/compiler/aco_print_ir.cpp')
-rw-r--r-- | src/amd/compiler/aco_print_ir.cpp | 76 |
1 files changed, 33 insertions, 43 deletions
diff --git a/src/amd/compiler/aco_print_ir.cpp b/src/amd/compiler/aco_print_ir.cpp index b216072a3d4..0654dfc9457 100644 --- a/src/amd/compiler/aco_print_ir.cpp +++ b/src/amd/compiler/aco_print_ir.cpp @@ -860,50 +860,40 @@ print_block_kind(uint16_t kind, FILE* output) static void print_stage(Stage stage, FILE* output) { - fprintf(output, "ACO shader stage: "); - - if (stage == compute_cs) - fprintf(output, "compute_cs"); - else if (stage == fragment_fs) - fprintf(output, "fragment_fs"); - else if (stage == vertex_ls) - fprintf(output, "vertex_ls"); - else if (stage == vertex_es) - fprintf(output, "vertex_es"); - else if (stage == vertex_vs) - fprintf(output, "vertex_vs"); - else if (stage == tess_control_hs) - fprintf(output, "tess_control_hs"); - else if (stage == vertex_tess_control_hs) - fprintf(output, "vertex_tess_control_hs"); - else if (stage == tess_eval_es) - fprintf(output, "tess_eval_es"); - else if (stage == tess_eval_vs) - fprintf(output, "tess_eval_vs"); - else if (stage == geometry_gs) - fprintf(output, "geometry_gs"); - else if (stage == vertex_geometry_gs) - fprintf(output, "vertex_geometry_gs"); - else if (stage == tess_eval_geometry_gs) - fprintf(output, "tess_eval_geometry_gs"); - else if (stage == vertex_ngg) - fprintf(output, "vertex_ngg"); - else if (stage == tess_eval_ngg) - fprintf(output, "tess_eval_ngg"); - else if (stage == vertex_geometry_ngg) - fprintf(output, "vertex_geometry_ngg"); - else if (stage == tess_eval_geometry_ngg) - fprintf(output, "tess_eval_geometry_ngg"); - else if (stage == mesh_ngg) - fprintf(output, "mesh_ngg"); - else if (stage == task_cs) - fprintf(output, "task_cs"); - else if (stage == raytracing_cs) - fprintf(output, "raytracing_cs"); - else - fprintf(output, "unknown"); + fprintf(output, "ACO shader stage: SW ("); + + u_foreach_bit (s, (uint32_t)stage.sw) { + switch ((SWStage)(1 << s)) { + case SWStage::VS: fprintf(output, "VS"); break; + case SWStage::GS: fprintf(output, "GS"); break; + case SWStage::TCS: fprintf(output, "TCS"); break; + case SWStage::TES: fprintf(output, "TES"); break; + case SWStage::FS: fprintf(output, "FS"); break; + case SWStage::CS: fprintf(output, "CS"); break; + case SWStage::TS: fprintf(output, "TS"); break; + case SWStage::MS: fprintf(output, "MS"); break; + case SWStage::RT: fprintf(output, "RT"); break; + default: unreachable("invalid SW stage"); + } + if (stage.num_sw_stages() > 1) + fprintf(output, "+"); + } - fprintf(output, "\n"); + fprintf(output, "), HW ("); + + switch (stage.hw) { + case AC_HW_LOCAL_SHADER: fprintf(output, "LOCAL_SHADER"); break; + case AC_HW_HULL_SHADER: fprintf(output, "HULL_SHADER"); break; + case AC_HW_EXPORT_SHADER: fprintf(output, "EXPORT_SHADER"); break; + case AC_HW_LEGACY_GEOMETRY_SHADER: fprintf(output, "LEGACY_GEOMETRY_SHADER"); break; + case AC_HW_VERTEX_SHADER: fprintf(output, "VERTEX_SHADER"); break; + case AC_HW_NEXT_GEN_GEOMETRY_SHADER: fprintf(output, "NEXT_GEN_GEOMETRY_SHADER"); break; + case AC_HW_PIXEL_SHADER: fprintf(output, "PIXEL_SHADER"); break; + case AC_HW_COMPUTE_SHADER: fprintf(output, "COMPUTE_SHADER"); break; + default: unreachable("invalid HW stage"); + } + + fprintf(output, ")\n"); } void |