summaryrefslogtreecommitdiff
path: root/src/gallium
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2017-08-25 16:08:50 +0200
committerNicolai Hähnle <nicolai.haehnle@amd.com>2017-09-04 13:50:47 +0200
commit55df3d228679b5e57a1b13fbd9124977f548a66a (patch)
tree2858c080ef32b241f7aa795b6b176ecb5953331b /src/gallium
parent30a2f0dfd46de9dbba42ada8d91292b742ed17c8 (diff)
radeonsi: fix compute shader state dumping
Fixes: 420c438589c8 ("radeonsi: log draw and compute state into log context") Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/radeonsi/si_debug.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/gallium/drivers/radeonsi/si_debug.c b/src/gallium/drivers/radeonsi/si_debug.c
index 4e8d861019a..28c777d105b 100644
--- a/src/gallium/drivers/radeonsi/si_debug.c
+++ b/src/gallium/drivers/radeonsi/si_debug.c
@@ -60,6 +60,7 @@ struct si_log_chunk_shader {
*/
struct si_context *ctx;
struct si_shader *shader;
+ enum pipe_shader_type processor;
/* For keep-alive reference counts */
struct si_shader_selector *sel;
@@ -80,7 +81,7 @@ si_log_chunk_shader_print(void *data, FILE *f)
{
struct si_log_chunk_shader *chunk = data;
struct si_screen *sscreen = chunk->ctx->screen;
- si_dump_shader(sscreen, chunk->shader->selector->info.processor,
+ si_dump_shader(sscreen, chunk->processor,
chunk->shader, f);
}
@@ -100,18 +101,23 @@ static void si_dump_gfx_shader(struct si_context *ctx,
struct si_log_chunk_shader *chunk = CALLOC_STRUCT(si_log_chunk_shader);
chunk->ctx = ctx;
+ chunk->processor = state->cso->info.processor;
chunk->shader = current;
si_shader_selector_reference(ctx, &chunk->sel, current->selector);
u_log_chunk(log, &si_log_chunk_type_shader, chunk);
}
-static void si_dump_compute_shader(const struct si_cs_shader_state *state,
+static void si_dump_compute_shader(struct si_context *ctx,
struct u_log_context *log)
{
- if (!state->program || state->program != state->emitted_program)
+ const struct si_cs_shader_state *state = &ctx->cs_shader_state;
+
+ if (!state->program)
return;
struct si_log_chunk_shader *chunk = CALLOC_STRUCT(si_log_chunk_shader);
+ chunk->ctx = ctx;
+ chunk->processor = PIPE_SHADER_COMPUTE;
chunk->shader = &state->program->shader;
si_compute_reference(&chunk->program, state->program);
u_log_chunk(log, &si_log_chunk_type_shader, chunk);
@@ -745,8 +751,7 @@ static void si_dump_gfx_descriptors(struct si_context *sctx,
static void si_dump_compute_descriptors(struct si_context *sctx,
struct u_log_context *log)
{
- if (!sctx->cs_shader_state.program ||
- sctx->cs_shader_state.program != sctx->cs_shader_state.emitted_program)
+ if (!sctx->cs_shader_state.program)
return;
si_dump_descriptors(sctx, PIPE_SHADER_COMPUTE, NULL, log);
@@ -1068,7 +1073,7 @@ 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_shader(sctx, log);
si_dump_compute_descriptors(sctx, log);
}