pan/bi: Add cmdline option for verbose disassembly
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 31 Mar 2020 17:08:16 +0000 (13:08 -0400)
committerMarge Bot <eric+marge@anholt.net>
Wed, 1 Apr 2020 02:25:05 +0000 (02:25 +0000)
Useful for debugging packing.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4396>

src/panfrost/bifrost/cmdline.c

index a0be7605b8b248159d1354fd28c5f76dcb17d58a..f82c613115b988b0e8a7a0580aa06979eb5b54a8 100644 (file)
@@ -78,7 +78,7 @@ compile_shader(char **argv, bool vertex_only)
 }
 
 static void
-disassemble(const char *filename)
+disassemble(const char *filename, bool verbose)
 {
         FILE *fp = fopen(filename, "rb");
         assert(fp);
@@ -94,7 +94,7 @@ disassemble(const char *filename)
         }
         fclose(fp);
 
-        disassemble_bifrost(stdout, code, filesize, false);
+        disassemble_bifrost(stdout, code, filesize, verbose);
         free(code);
 }
 
@@ -166,7 +166,9 @@ main(int argc, char **argv)
         if (strcmp(argv[1], "compile") == 0)
                 compile_shader(&argv[2], false);
         else if (strcmp(argv[1], "disasm") == 0)
-                disassemble(argv[2]);
+                disassemble(argv[2], false);
+        else if (strcmp(argv[1], "disasm-verbose") == 0)
+                disassemble(argv[2], true);
         else if (strcmp(argv[1], "test-vertex") == 0)
                 test_vertex(&argv[2]);
         else if (strcmp(argv[1], "run") == 0)