From 571597bf470e8b108395ac6a2a8d33108a40910f Mon Sep 17 00:00:00 2001 From: Nicolai Hähnle Date: Mon, 8 May 2017 13:01:37 +0200 Subject: radeonsi: dump compute shader as part of debug dump MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák --- src/gallium/drivers/radeonsi/si_debug.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/gallium/drivers/radeonsi/si_debug.c b/src/gallium/drivers/radeonsi/si_debug.c index 2e727f6adb4..6e310bb9f5d 100644 --- a/src/gallium/drivers/radeonsi/si_debug.c +++ b/src/gallium/drivers/radeonsi/si_debug.c @@ -25,6 +25,7 @@ */ #include "si_pipe.h" +#include "si_compute.h" #include "sid.h" #include "gfx9d.h" #include "sid_tables.h" @@ -55,6 +56,15 @@ static void si_dump_gfx_shader(struct si_screen *sscreen, si_dump_shader(sscreen, state->cso->info.processor, current, f); } +static void si_dump_compute_shader(struct si_screen *sscreen, + const struct si_cs_shader_state *state, FILE *f) +{ + if (!state->program || state->program != state->emitted_program) + return; + + si_dump_shader(sscreen, PIPE_SHADER_COMPUTE, &state->program->shader, f); +} + /** * Shader compiles can be overridden with arbitrary ELF objects by setting * the environment variable RADEON_REPLACE_SHADERS=num1:filename1[;num2:filename2] @@ -769,6 +779,7 @@ static void si_dump_debug_state(struct pipe_context *ctx, FILE *f, si_dump_gfx_shader(sctx->screen, &sctx->tes_shader, f); si_dump_gfx_shader(sctx->screen, &sctx->gs_shader, f); si_dump_gfx_shader(sctx->screen, &sctx->ps_shader, f); + si_dump_compute_shader(sctx->screen, &sctx->cs_shader_state, f); if (flags & PIPE_DUMP_DEVICE_STATUS_REGISTERS) { si_dump_annotated_shaders(sctx, f); -- cgit v1.2.3