summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2016-07-22 23:23:11 +0200
committerMarek Olšák <[email protected]>2016-07-26 23:06:46 +0200
commitdd66f9d3e71ba27960040375709a05f87b7a735b (patch)
treec35280df5ff7f660b0cb3b19347aeabd1366eb76 /src/gallium
parentb47727a83ad6b5386f27b2c174a5c0f110a61038 (diff)
radeonsi: move the shader key dumping to si_shader_dump
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/radeonsi/si_debug.c1
-rw-r--r--src/gallium/drivers/radeonsi/si_shader.c12
-rw-r--r--src/gallium/drivers/radeonsi/si_shader.h1
3 files changed, 9 insertions, 5 deletions
diff --git a/src/gallium/drivers/radeonsi/si_debug.c b/src/gallium/drivers/radeonsi/si_debug.c
index 35d961d34f5..d9d4890b90e 100644
--- a/src/gallium/drivers/radeonsi/si_debug.c
+++ b/src/gallium/drivers/radeonsi/si_debug.c
@@ -40,7 +40,6 @@ static void si_dump_shader(struct si_screen *sscreen,
if (!state->cso || !state->current)
return;
- si_dump_shader_key(state->cso->type, &state->current->key, f);
si_shader_dump(sscreen, state->current, NULL,
state->cso->info.processor, f);
}
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index adf706c877e..cb270e087f3 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -151,6 +151,9 @@ static void si_llvm_emit_barrier(const struct lp_build_tgsi_action *action,
struct lp_build_tgsi_context *bld_base,
struct lp_build_emit_data *emit_data);
+static void si_dump_shader_key(unsigned shader, union si_shader_key *key,
+ FILE *f);
+
/* Ideally pass the sample mask input to the PS epilog as v13, which
* is its usual location, so that the shader doesn't have to add v_mov.
*/
@@ -6244,6 +6247,10 @@ void si_shader_dump(struct si_screen *sscreen, struct si_shader *shader,
struct pipe_debug_callback *debug, unsigned processor,
FILE *file)
{
+ if (file != stderr ||
+ r600_can_dump_shader(&sscreen->b, processor))
+ si_dump_shader_key(processor, &shader->key, file);
+
if (file != stderr && shader->binary.llvm_ir_string) {
fprintf(file, "\n%s - main shader part - LLVM IR:\n\n",
si_get_shader_name(shader, processor));
@@ -6440,7 +6447,8 @@ static int si_generate_gs_copy_shader(struct si_screen *sscreen,
return r;
}
-void si_dump_shader_key(unsigned shader, union si_shader_key *key, FILE *f)
+static void si_dump_shader_key(unsigned shader, union si_shader_key *key,
+ FILE *f)
{
int i;
@@ -6613,8 +6621,6 @@ int si_compile_tgsi_shader(struct si_screen *sscreen,
* conversion fails. */
if (r600_can_dump_shader(&sscreen->b, sel->info.processor) &&
!(sscreen->b.debug_flags & DBG_NO_TGSI)) {
- if (is_monolithic)
- si_dump_shader_key(sel->type, &shader->key, stderr);
tgsi_dump(sel->tokens, 0);
si_dump_streamout(&sel->so);
}
diff --git a/src/gallium/drivers/radeonsi/si_shader.h b/src/gallium/drivers/radeonsi/si_shader.h
index 29069316548..6073296ac9f 100644
--- a/src/gallium/drivers/radeonsi/si_shader.h
+++ b/src/gallium/drivers/radeonsi/si_shader.h
@@ -488,7 +488,6 @@ int si_compile_tgsi_shader(struct si_screen *sscreen,
int si_shader_create(struct si_screen *sscreen, LLVMTargetMachineRef tm,
struct si_shader *shader,
struct pipe_debug_callback *debug);
-void si_dump_shader_key(unsigned shader, union si_shader_key *key, FILE *f);
int si_compile_llvm(struct si_screen *sscreen,
struct radeon_shader_binary *binary,
struct si_shader_config *conf,