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: "); + fprintf(output, "ACO shader stage: SW ("); - 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"); + 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