Mesa (master): aco: Print shader stage in aco_print_program.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Apr 7 11:44:57 UTC 2020


Module: Mesa
Branch: master
Commit: aa42b504d6e8a1f7129148a1ca42ef80009b72f3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=aa42b504d6e8a1f7129148a1ca42ef80009b72f3

Author: Timur Kristóf <timur.kristof at gmail.com>
Date:   Wed Apr  1 13:39:25 2020 +0200

aco: Print shader stage in aco_print_program.

Signed-off-by: Timur Kristóf <timur.kristof at gmail.com>
Reviewed-by: Daniel Schürmann <daniel at schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3576>

---

 src/amd/compiler/aco_print_ir.cpp | 46 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/src/amd/compiler/aco_print_ir.cpp b/src/amd/compiler/aco_print_ir.cpp
index 9324632d433..fb771aafa37 100644
--- a/src/amd/compiler/aco_print_ir.cpp
+++ b/src/amd/compiler/aco_print_ir.cpp
@@ -693,6 +693,50 @@ static void print_block_kind(uint16_t kind, FILE *output)
       fprintf(output, "export_end, ");
 }
 
+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 == gs_copy_vs)
+      fprintf(output, "gs_copy_vs");
+   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 == ngg_vertex_gs)
+      fprintf(output, "ngg_vertex_gs");
+   else if (stage == ngg_tess_eval_gs)
+      fprintf(output, "ngg_tess_eval_gs");
+   else if (stage == ngg_vertex_geometry_gs)
+      fprintf(output, "ngg_vertex_geometry_gs");
+   else if (stage == ngg_tess_eval_geometry_gs)
+      fprintf(output, "ngg_tess_eval_geometry_gs");
+   else
+      fprintf(output, "unknown");
+
+   fprintf(output, "\n");
+}
+
 void aco_print_block(const struct Block* block, FILE *output)
 {
    fprintf(output, "BB%d\n", block->index);
@@ -714,6 +758,8 @@ void aco_print_block(const struct Block* block, FILE *output)
 
 void aco_print_program(Program *program, FILE *output)
 {
+   print_stage(program->stage, output);
+
    for (Block const& block : program->blocks)
       aco_print_block(&block, output);
 



More information about the mesa-commit mailing list