From 38cfd5160ad3859dfd2c4af289f860198d6f4590 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolai=20H=C3=A4hnle?= Date: Fri, 7 Oct 2016 17:14:54 +0200 Subject: [PATCH] gallium/radeon: assign a name to LLVM output variables in debug builds MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This can be helpful with R600_DEBUG=preoptir. Reviewed-by: Edward O'Callaghan Reviewed-by: Marek Olšák --- src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c index da4a030a9ef..c8435417419 100644 --- a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c +++ b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c @@ -703,6 +703,7 @@ static void emit_declaration(struct lp_build_tgsi_context *bld_base, case TGSI_FILE_OUTPUT: { + char name[16] = ""; unsigned idx; for (idx = decl->Range.First; idx <= decl->Range.Last; idx++) { unsigned chan; @@ -710,9 +711,13 @@ static void emit_declaration(struct lp_build_tgsi_context *bld_base, if (ctx->soa.outputs[idx][0]) continue; for (chan = 0; chan < TGSI_NUM_CHANNELS; chan++) { +#ifdef DEBUG + snprintf(name, sizeof(name), "OUT%d.%c", + idx, "xyzw"[chan % 4]); +#endif ctx->soa.outputs[idx][chan] = lp_build_alloca_undef( &ctx->gallivm, - ctx->soa.bld_base.base.elem_type, ""); + ctx->soa.bld_base.base.elem_type, name); } } break; -- 2.30.2