mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 00:20:09 +01:00
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 <jordan.l.justen@intel.com>
This commit is contained in:
parent
fad7801afd
commit
04f97eefa3
1 changed files with 30 additions and 6 deletions
|
|
@ -510,6 +510,30 @@ iris_setup_uniforms(const struct brw_compiler *compiler,
|
||||||
*out_num_cbufs = num_cbufs;
|
*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.
|
* Compile a vertex shader, and upload the assembly.
|
||||||
*/
|
*/
|
||||||
|
|
@ -580,7 +604,7 @@ iris_compile_vs(struct iris_context *ice,
|
||||||
num_cbufs);
|
num_cbufs);
|
||||||
|
|
||||||
if (ish->compiled_once) {
|
if (ish->compiled_once) {
|
||||||
perf_debug(&ice->dbg, "Recompiling vertex shader\n");
|
iris_debug_recompile(ice, &nir->info, key->program_string_id, key);
|
||||||
} else {
|
} else {
|
||||||
ish->compiled_once = true;
|
ish->compiled_once = true;
|
||||||
}
|
}
|
||||||
|
|
@ -770,7 +794,7 @@ iris_compile_tcs(struct iris_context *ice,
|
||||||
|
|
||||||
if (ish) {
|
if (ish) {
|
||||||
if (ish->compiled_once) {
|
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 {
|
} else {
|
||||||
ish->compiled_once = true;
|
ish->compiled_once = true;
|
||||||
}
|
}
|
||||||
|
|
@ -873,7 +897,7 @@ iris_compile_tes(struct iris_context *ice,
|
||||||
num_cbufs);
|
num_cbufs);
|
||||||
|
|
||||||
if (ish->compiled_once) {
|
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 {
|
} else {
|
||||||
ish->compiled_once = true;
|
ish->compiled_once = true;
|
||||||
}
|
}
|
||||||
|
|
@ -973,7 +997,7 @@ iris_compile_gs(struct iris_context *ice,
|
||||||
num_cbufs);
|
num_cbufs);
|
||||||
|
|
||||||
if (ish->compiled_once) {
|
if (ish->compiled_once) {
|
||||||
perf_debug(&ice->dbg, "Recompiling geometry shader\n");
|
iris_debug_recompile(ice, &nir->info, key->program_string_id, key);
|
||||||
} else {
|
} else {
|
||||||
ish->compiled_once = true;
|
ish->compiled_once = true;
|
||||||
}
|
}
|
||||||
|
|
@ -1063,7 +1087,7 @@ iris_compile_fs(struct iris_context *ice,
|
||||||
num_cbufs);
|
num_cbufs);
|
||||||
|
|
||||||
if (ish->compiled_once) {
|
if (ish->compiled_once) {
|
||||||
perf_debug(&ice->dbg, "Recompiling fragment shader\n");
|
iris_debug_recompile(ice, &nir->info, key->program_string_id, key);
|
||||||
} else {
|
} else {
|
||||||
ish->compiled_once = true;
|
ish->compiled_once = true;
|
||||||
}
|
}
|
||||||
|
|
@ -1297,7 +1321,7 @@ iris_compile_cs(struct iris_context *ice,
|
||||||
num_cbufs);
|
num_cbufs);
|
||||||
|
|
||||||
if (ish->compiled_once) {
|
if (ish->compiled_once) {
|
||||||
perf_debug(&ice->dbg, "Recompiling compute shader\n");
|
iris_debug_recompile(ice, &nir->info, key->program_string_id, key);
|
||||||
} else {
|
} else {
|
||||||
ish->compiled_once = true;
|
ish->compiled_once = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue