Mesa (master): radeonsi: Dump TGSI code prior to doing TGSI-> LLVM conversion.

Tom Stellard tstellar at kemper.freedesktop.org
Thu Jul 12 18:44:44 UTC 2012


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

Author: Tom Stellard <thomas.stellard at amd.com>
Date:   Thu Jul 12 10:40:47 2012 -0400

radeonsi: Dump TGSI code prior to doing TGSI->LLVM conversion.

This way if the conversion fails, we know what the TGSI shader looks
like.

---

 src/gallium/drivers/radeonsi/radeonsi_shader.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/radeonsi_shader.c b/src/gallium/drivers/radeonsi/radeonsi_shader.c
index d0820b8..7b805b5 100644
--- a/src/gallium/drivers/radeonsi/radeonsi_shader.c
+++ b/src/gallium/drivers/radeonsi/radeonsi_shader.c
@@ -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);




More information about the mesa-commit mailing list