summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2019-04-15 22:17:49 -0700
committerKenneth Graunke <[email protected]>2019-04-16 09:01:18 -0700
commit04f97eefa35d8337b6e078be003ad5f5fe5656fe (patch)
treeb35d63d174db246fce52fed2c661cab6d7fd8049 /src
parentfad7801afd194c504bd945c497741ecaf04e2cdd (diff)
iris: Print the reason for shader recompiles.
I was lazy earlier and hadn't bothered typing / refactoring this. Now I'm hitting some extra recompiles and would like to see why. Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/iris/iris_program.c36
1 files changed, 30 insertions, 6 deletions
diff --git a/src/gallium/drivers/iris/iris_program.c b/src/gallium/drivers/iris/iris_program.c
index 7da3a372b10..061d379ec29 100644
--- a/src/gallium/drivers/iris/iris_program.c
+++ b/src/gallium/drivers/iris/iris_program.c
@@ -510,6 +510,30 @@ iris_setup_uniforms(const struct brw_compiler *compiler,
*out_num_cbufs = num_cbufs;
}
+static void
+iris_debug_recompile(struct iris_context *ice,
+ struct shader_info *info,
+ unsigned program_string_id,
+ const void *key)
+{
+ struct iris_screen *screen = (struct iris_screen *) ice->ctx.screen;
+ const struct brw_compiler *c = screen->compiler;
+
+ if (!info)
+ return;
+
+ c->shader_perf_log(&ice->dbg, "Recompiling %s shader for program %s: %s\n",
+ _mesa_shader_stage_to_string(info->stage),
+ info->name ? info->name : "(no identifier)",
+ info->label ? info->label : "");
+
+ const void *old_key =
+ iris_find_previous_compile(ice, info->stage, program_string_id);
+
+ brw_debug_key_recompile(c, &ice->dbg, info->stage, old_key, key);
+}
+
+
/**
* Compile a vertex shader, and upload the assembly.
*/
@@ -580,7 +604,7 @@ iris_compile_vs(struct iris_context *ice,
num_cbufs);
if (ish->compiled_once) {
- perf_debug(&ice->dbg, "Recompiling vertex shader\n");
+ iris_debug_recompile(ice, &nir->info, key->program_string_id, key);
} else {
ish->compiled_once = true;
}
@@ -770,7 +794,7 @@ iris_compile_tcs(struct iris_context *ice,
if (ish) {
if (ish->compiled_once) {
- perf_debug(&ice->dbg, "Recompiling tessellation control shader\n");
+ iris_debug_recompile(ice, &nir->info, key->program_string_id, key);
} else {
ish->compiled_once = true;
}
@@ -873,7 +897,7 @@ iris_compile_tes(struct iris_context *ice,
num_cbufs);
if (ish->compiled_once) {
- perf_debug(&ice->dbg, "Recompiling tessellation evaluation shader\n");
+ iris_debug_recompile(ice, &nir->info, key->program_string_id, key);
} else {
ish->compiled_once = true;
}
@@ -973,7 +997,7 @@ iris_compile_gs(struct iris_context *ice,
num_cbufs);
if (ish->compiled_once) {
- perf_debug(&ice->dbg, "Recompiling geometry shader\n");
+ iris_debug_recompile(ice, &nir->info, key->program_string_id, key);
} else {
ish->compiled_once = true;
}
@@ -1063,7 +1087,7 @@ iris_compile_fs(struct iris_context *ice,
num_cbufs);
if (ish->compiled_once) {
- perf_debug(&ice->dbg, "Recompiling fragment shader\n");
+ iris_debug_recompile(ice, &nir->info, key->program_string_id, key);
} else {
ish->compiled_once = true;
}
@@ -1297,7 +1321,7 @@ iris_compile_cs(struct iris_context *ice,
num_cbufs);
if (ish->compiled_once) {
- perf_debug(&ice->dbg, "Recompiling compute shader\n");
+ iris_debug_recompile(ice, &nir->info, key->program_string_id, key);
} else {
ish->compiled_once = true;
}