diff options
author | Marek Olšák <[email protected]> | 2016-07-22 23:40:45 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2016-07-26 23:06:46 +0200 |
commit | 1e5f00f9d5f412526d025f8f4762160ce7b5f2ba (patch) | |
tree | dd95c6ab356afabac296dfa377801cdd5282edda /src/gallium/drivers/radeonsi/si_debug.c | |
parent | 18475aab6d484d4eb49b1cc9124c9aabc79f8527 (diff) |
radeonsi: pre-generate shader logs for ddebug
This cuts down the overhead of si_dump_shader when ddebug is capturing
shader logs, which is done for every draw call unconditionally (that's
quite a lot of work for a draw call).
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_debug.c')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_debug.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gallium/drivers/radeonsi/si_debug.c b/src/gallium/drivers/radeonsi/si_debug.c index d9d4890b90e..e030f487542 100644 --- a/src/gallium/drivers/radeonsi/si_debug.c +++ b/src/gallium/drivers/radeonsi/si_debug.c @@ -37,11 +37,16 @@ DEBUG_GET_ONCE_OPTION(replace_shaders, "RADEON_REPLACE_SHADERS", NULL) static void si_dump_shader(struct si_screen *sscreen, struct si_shader_ctx_state *state, FILE *f) { - if (!state->cso || !state->current) + struct si_shader *current = state->current; + + if (!state->cso || !current) return; - si_shader_dump(sscreen, state->current, NULL, - state->cso->info.processor, f); + if (current->shader_log) + fwrite(current->shader_log, current->shader_log_size, 1, f); + else + si_shader_dump(sscreen, state->current, NULL, + state->cso->info.processor, f); } /** |