summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2016-10-07 17:14:54 +0200
committerNicolai Hähnle <nicolai.haehnle@amd.com>2016-10-07 18:02:26 +0200
commitfb00b26416619bb16ed90b788298bb7ceef97b35 (patch)
tree918e9d43a8b55c987d36cac96874f490859f288f
parent13e3e68e72678ef886806fa5401d5b0b2ad92bc3 (diff)
gallium/radeon: assign a name to LLVM output variables in debug builds
This can be helpful with R600_DEBUG=preoptir.
-rw-r--r--src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
index da4a030a9e..c843541741 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;