asahi: Add perf debug for shader variants
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Sat, 11 Mar 2023 22:48:56 +0000 (17:48 -0500)
committerMarge Bot <emma+marge@anholt.net>
Fri, 7 Apr 2023 03:23:03 +0000 (03:23 +0000)
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 <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>

src/gallium/drivers/asahi/agx_state.c

index bbbbb3a..1ac5ac4 100644 (file)
@@ -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) {