pan/bi: Wire Valhall disassembler into compiler
authorAlyssa Rosenzweig <alyssa@collabora.com>
Tue, 1 Mar 2022 19:13:53 +0000 (14:13 -0500)
committerMarge Bot <emma+marge@anholt.net>
Tue, 1 Mar 2022 19:43:22 +0000 (19:43 +0000)
Useful when we grow Valhall support (soon!)

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

src/panfrost/bifrost/bifrost_compile.c

index 9a1feb2..3c7baec 100644 (file)
@@ -30,6 +30,7 @@
 #include "util/u_debug.h"
 
 #include "disassemble.h"
+#include "valhall/disassemble.h"
 #include "bifrost_compile.h"
 #include "compiler.h"
 #include "bi_quirks.h"
@@ -4083,8 +4084,16 @@ bi_compile_variant_nir(nir_shader *nir,
         }
 
         if (bifrost_debug & BIFROST_DBG_SHADERS && !skip_internal) {
-                disassemble_bifrost(stdout, binary->data + offset, binary->size - offset,
-                                    bifrost_debug & BIFROST_DBG_VERBOSE);
+                if (ctx->arch <= 8) {
+                        disassemble_bifrost(stdout, binary->data + offset,
+                                            binary->size - offset,
+                                            bifrost_debug & BIFROST_DBG_VERBOSE);
+                } else {
+                        disassemble_valhall(stdout, binary->data + offset,
+                                            binary->size - offset,
+                                            bifrost_debug & BIFROST_DBG_VERBOSE);
+                }
+
                 fflush(stdout);
         }