summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_debug.c
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2017-08-04 19:35:30 +0200
committerNicolai Hähnle <[email protected]>2017-08-22 09:53:34 +0200
commit420c438589c86db1fbb2a0b3c36c04ff5a061e30 (patch)
treeefd0ba4fe2ed71bdfb94a9e1fba344f711e8446d /src/gallium/drivers/radeonsi/si_debug.c
parent4c3f36ec6b59de2245257c819df7628aaa6bf57b (diff)
radeonsi: log draw and compute state into log context
Also add missing trace emits and CS logging for compute launches. Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_debug.c')
-rw-r--r--src/gallium/drivers/radeonsi/si_debug.c72
1 files changed, 40 insertions, 32 deletions
diff --git a/src/gallium/drivers/radeonsi/si_debug.c b/src/gallium/drivers/radeonsi/si_debug.c
index bf63f9f5216..278887c7063 100644
--- a/src/gallium/drivers/radeonsi/si_debug.c
+++ b/src/gallium/drivers/radeonsi/si_debug.c
@@ -1067,34 +1067,38 @@ static void si_dump_debug_state(struct pipe_context *ctx, FILE *f,
si_dump_command("Wave information", "umr -O bits -wa", f);
}
}
+}
- struct u_log_context log;
- u_log_context_init(&log);
-
- if (flags & PIPE_DUMP_CURRENT_STATES)
- si_dump_framebuffer(sctx, &log);
-
- if (flags & PIPE_DUMP_CURRENT_SHADERS) {
- si_dump_gfx_shader(sctx, &sctx->vs_shader, &log);
- si_dump_gfx_shader(sctx, &sctx->tcs_shader, &log);
- si_dump_gfx_shader(sctx, &sctx->tes_shader, &log);
- si_dump_gfx_shader(sctx, &sctx->gs_shader, &log);
- si_dump_gfx_shader(sctx, &sctx->ps_shader, &log);
- si_dump_compute_shader(&sctx->cs_shader_state, &log);
-
- si_dump_descriptor_list(&sctx->descriptors[SI_DESCS_RW_BUFFERS],
- "", "RW buffers", 4, SI_NUM_RW_BUFFERS,
- si_identity, &log);
- si_dump_gfx_descriptors(sctx, &sctx->vs_shader, &log);
- si_dump_gfx_descriptors(sctx, &sctx->tcs_shader, &log);
- si_dump_gfx_descriptors(sctx, &sctx->tes_shader, &log);
- si_dump_gfx_descriptors(sctx, &sctx->gs_shader, &log);
- si_dump_gfx_descriptors(sctx, &sctx->ps_shader, &log);
- si_dump_compute_descriptors(sctx, &log);
- }
+void si_log_draw_state(struct si_context *sctx, struct u_log_context *log)
+{
+ if (!log)
+ return;
- u_log_new_page_print(&log, f);
- u_log_context_destroy(&log);
+ si_dump_framebuffer(sctx, log);
+
+ si_dump_gfx_shader(sctx, &sctx->vs_shader, log);
+ si_dump_gfx_shader(sctx, &sctx->tcs_shader, log);
+ si_dump_gfx_shader(sctx, &sctx->tes_shader, log);
+ si_dump_gfx_shader(sctx, &sctx->gs_shader, log);
+ si_dump_gfx_shader(sctx, &sctx->ps_shader, log);
+
+ si_dump_descriptor_list(&sctx->descriptors[SI_DESCS_RW_BUFFERS],
+ "", "RW buffers", 4, SI_NUM_RW_BUFFERS,
+ si_identity, log);
+ si_dump_gfx_descriptors(sctx, &sctx->vs_shader, log);
+ si_dump_gfx_descriptors(sctx, &sctx->tcs_shader, log);
+ si_dump_gfx_descriptors(sctx, &sctx->tes_shader, log);
+ si_dump_gfx_descriptors(sctx, &sctx->gs_shader, log);
+ si_dump_gfx_descriptors(sctx, &sctx->ps_shader, log);
+}
+
+void si_log_compute_state(struct si_context *sctx, struct u_log_context *log)
+{
+ if (!log)
+ return;
+
+ si_dump_compute_shader(&sctx->cs_shader_state, log);
+ si_dump_compute_descriptors(sctx, log);
}
static void si_dump_dma(struct si_context *sctx,
@@ -1246,13 +1250,17 @@ void si_check_vm_faults(struct r600_common_context *ctx,
sctx->apitrace_call_number);
switch (ring) {
- case RING_GFX:
- si_dump_debug_state(&sctx->b.b, f,
- PIPE_DUMP_CURRENT_STATES |
- PIPE_DUMP_CURRENT_SHADERS |
- PIPE_DUMP_LAST_COMMAND_BUFFER);
- break;
+ case RING_GFX: {
+ struct u_log_context log;
+ u_log_context_init(&log);
+ si_log_draw_state(sctx, &log);
+ si_log_compute_state(sctx, &log);
+
+ u_log_new_page_print(&log, f);
+ u_log_context_destroy(&log);
+ break;
+ }
case RING_DMA:
si_dump_dma(sctx, saved, f);
break;