radeonsi: Dump TGSI code prior to doing TGSI->LLVM conversion.
authorTom Stellard <thomas.stellard@amd.com>
Thu, 12 Jul 2012 14:40:47 +0000 (10:40 -0400)
committerTom Stellard <thomas.stellard@amd.com>
Thu, 12 Jul 2012 17:53:22 +0000 (13:53 -0400)
This way if the conversion fails, we know what the TGSI shader looks
like.

src/gallium/drivers/radeonsi/radeonsi_shader.c

index d0820b80302d1b937f3ddcbc9098d0471efabdad..7b805b59948f41cb008c59e065a6de458366a313 100644 (file)
@@ -574,13 +574,18 @@ int si_pipe_shader_create(
 
        shader->shader.nr_cbufs = rctx->nr_cbufs;
 
+       /* Dump TGSI code before doing TGSI->LLVM conversion in case the
+        * conversion fails. */
+       if (dump) {
+               tgsi_dump(shader->tokens, 0);
+       }
+
        lp_build_tgsi_llvm(bld_base, shader->tokens);
 
        radeon_llvm_finalize_module(&si_shader_ctx.radeon_bld);
 
        mod = bld_base->base.gallivm->module;
        if (dump) {
-               tgsi_dump(shader->tokens, 0);
                LLVMDumpModule(mod);
        }
        radeon_llvm_compile(mod, &inst_bytes, &inst_byte_count, "SI", dump);