From 1418ea0d0015d6bf8a5256668f4485ae22ffbc0a Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Wed, 13 May 2020 09:54:57 -0700 Subject: [PATCH] freedreno/a6xx: emit shader names in debug builds To simplify mapping a shader in a cmdstream trace back to glsl. Signed-off-by: Rob Clark Part-of: --- src/gallium/drivers/freedreno/a6xx/fd6_program.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_program.c b/src/gallium/drivers/freedreno/a6xx/fd6_program.c index 9faa11bd384..9f1510942c6 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_program.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_program.c @@ -78,6 +78,13 @@ fd6_emit_shader(struct fd_ringbuffer *ring, const struct ir3_shader_variant *so) unreachable(""); } +#ifdef DEBUG + /* Name should generally match what you get with MESA_SHADER_CAPTURE_PATH: */ + const char *name = so->shader->nir->info.name; + if (name) + fd_emit_string5(ring, name, strlen(name)); +#endif + OUT_PKT4(ring, instrlen, 1); OUT_RING(ring, so->instrlen); -- 2.30.2