asahi: Allow no16 flag for disk cache
authorAsahi Lina <lina@asahilina.net>
Fri, 1 Sep 2023 09:52:14 +0000 (18:52 +0900)
committerMarge Bot <emma+marge@anholt.net>
Tue, 5 Sep 2023 18:50:34 +0000 (18:50 +0000)
The debug flags are already plumbed into driver_flags for the disk
cache, so we just need to actually allow some flags instead of bailing
out of the disk cache init.

We only care about no16 for production right now, and it's probably a
good idea to disable disk caching during most debug sessions, so
allowlist only that one.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>

src/gallium/drivers/asahi/agx_disk_cache.c

index bb5f54b..f33a971 100644 (file)
@@ -18,6 +18,9 @@
 #include "agx_disk_cache.h"
 #include "agx_state.h"
 
+/* Flags that are allowed and do not disable the disk cache */
+#define ALLOWED_FLAGS (AGX_DBG_NO16)
+
 /**
  * Compute a disk cache key for the given uncompiled shader and shader key.
  */
@@ -134,7 +137,7 @@ void
 agx_disk_cache_init(struct agx_screen *screen)
 {
 #ifdef ENABLE_SHADER_CACHE
-   if (agx_get_compiler_debug() || screen->dev.debug)
+   if (agx_get_compiler_debug() || (screen->dev.debug & ~ALLOWED_FLAGS))
       return;
 
    const char *renderer = screen->pscreen.get_name(&screen->pscreen);