radeonsi: dump NIR instead of TGSI when appropriate
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Fri, 19 May 2017 15:42:20 +0000 (17:42 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Mon, 31 Jul 2017 12:55:33 +0000 (14:55 +0200)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_shader.c

index 3903d163d18f5b256d9605eb08c655d28861a3df..ac58d87784a288636b689384ffb1a86d1642b0a3 100644 (file)
@@ -46,6 +46,7 @@
 #include "si_pipe.h"
 #include "sid.h"
 
+#include "compiler/nir/nir.h"
 
 static const char *scratch_rsrc_dword0_symbol =
        "SCRATCH_RSRC_DWORD0";
@@ -6215,7 +6216,10 @@ int si_compile_tgsi_shader(struct si_screen *sscreen,
         * conversion fails. */
        if (r600_can_dump_shader(&sscreen->b, sel->info.processor) &&
            !(sscreen->b.debug_flags & DBG_NO_TGSI)) {
-               tgsi_dump(sel->tokens, 0);
+               if (sel->tokens)
+                       tgsi_dump(sel->tokens, 0);
+               else
+                       nir_print_shader(sel->nir, stderr);
                si_dump_streamout(&sel->so);
        }