From 80adaa47e55aa662850893bc1f2732d2a0bdca4b Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sat, 11 Mar 2023 17:48:56 -0500 Subject: [PATCH] asahi: Add perf debug for shader variants Compiling this can cause jank. This is still an issue in Quake3. There is a way to solve it but it's rather involved and certainly not this weekend's project. Better perf debugging on the other hand apparently is ^_^ Signed-off-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/asahi/agx_state.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gallium/drivers/asahi/agx_state.c b/src/gallium/drivers/asahi/agx_state.c index bbbbb3a..1ac5ac4 100644 --- a/src/gallium/drivers/asahi/agx_state.c +++ b/src/gallium/drivers/asahi/agx_state.c @@ -1388,6 +1388,10 @@ agx_compile_variant(struct agx_device *dev, struct agx_uncompiled_shader *so, nir_shader *nir = nir_shader_clone(NULL, so->nir); + /* This can happen at inopportune times and cause jank, log it */ + perf_debug(dev, "Compiling shader variant #%u", + _mesa_hash_table_num_entries(so->variants)); + bool force_translucent = false; if (nir->info.stage == MESA_SHADER_VERTEX) { -- 2.7.4