freedreno: Emit debug messages when doing draw-time recompiles of shaders.

Right now that's "always" unless you have shaderdb set.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4562>
This commit is contained in:
Eric Anholt 2020-04-14 15:31:20 -07:00 committed by Marge Bot
parent a361567c46
commit 6f1e3235f2
2 changed files with 23 additions and 0 deletions

View File

@ -225,6 +225,9 @@ struct ir3_sampler_prefetch {
/* Configuration key used to identify a shader variant.. different
* shader variants can be used to implement features not supported
* in hw (two sided color), binning-pass vertex shader, etc.
*
* When adding to this struct, please update ir3_shader_variant()'s debug
* output.
*/
struct ir3_shader_key {
union {
@ -651,6 +654,11 @@ struct ir3_shader {
uint32_t id;
uint32_t variant_count;
/* Set by freedreno after shader_state_create, so we can emit debug info
* when recompiling a shader at draw time.
*/
bool initial_variants_done;
struct ir3_compiler *compiler;
struct ir3_ubo_analysis_state ubo_state;

View File

@ -86,6 +86,17 @@ ir3_shader_variant(struct ir3_shader *shader, struct ir3_shader_key key,
v = ir3_shader_get_variant(shader, &key, binning_pass, &created);
if (created) {
if (shader->initial_variants_done) {
pipe_debug_message(debug, SHADER_INFO,
"%s shader: recompiling at draw time: global 0x%08x, vsats %x/%x/%x, fsats %x/%x/%x, vfsamples %x/%x, astc %x/%x\n",
ir3_shader_stage(v),
key.global,
key.vsaturate_s, key.vsaturate_t, key.vsaturate_r,
key.fsaturate_s, key.fsaturate_t, key.fsaturate_r,
key.vsamples, key.fsamples,
key.vastc_srgb, key.fastc_srgb);
}
dump_shader_info(v, binning_pass, debug);
}
@ -176,6 +187,8 @@ ir3_shader_create(struct ir3_compiler *compiler,
ir3_shader_variant(shader, key, true, debug);
}
shader->initial_variants_done = true;
return shader;
}
@ -211,6 +224,8 @@ ir3_shader_create_compute(struct ir3_compiler *compiler,
ir3_shader_variant(shader, key, false, debug);
}
shader->initial_variants_done = true;
return shader;
}