From: Rob Clark Date: Wed, 13 May 2020 16:54:57 +0000 (-0700) Subject: freedreno/a6xx: emit shader names in debug builds X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1418ea0d0015d6bf8a5256668f4485ae22ffbc0a;p=mesa.git 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: --- 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);