aboutsummaryrefslogtreecommitdiffstats
path: root/src/util/disk_cache.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2020-09-18 10:42:52 -0700
committerMarge Bot <eric+marge@anholt.net>2020-09-22 20:41:25 +0000
commitee4cee6dbdfcafb0ec88fe010d4ae05ce06e2e52 (patch)
treee168321667d71600384085e7dd3037a955deb0e8 /src/util/disk_cache.c
parent25b36d900acb0d3d923bd0b99a6d8443b4616c73 (diff)
downloadexternal_mesa3d-ee4cee6dbdfcafb0ec88fe010d4ae05ce06e2e52.tar.gz
external_mesa3d-ee4cee6dbdfcafb0ec88fe010d4ae05ce06e2e52.tar.bz2
external_mesa3d-ee4cee6dbdfcafb0ec88fe010d4ae05ce06e2e52.zip
android: Disable trying to read/write to the disk cache.
We need the disk cache enabled in Android to get EGL_ANDROID_blob_cache's callbacks called, but we don't actually want to store anything on disk. Fixes "Failed to create //.cache for shader cache (Read-only file system)---disabling." spam on init. Reviewed-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6762>
Diffstat (limited to 'src/util/disk_cache.c')
-rw-r--r--src/util/disk_cache.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c
index 9953de62819..e1eee29839f 100644
--- a/src/util/disk_cache.c
+++ b/src/util/disk_cache.c
@@ -95,6 +95,14 @@ disk_cache_create(const char *gpu_name, const char *driver_id,
/* Assume failure. */
cache->path_init_failed = true;
+#ifdef ANDROID
+ /* Android needs the "disk cache" to be enabled for
+ * EGL_ANDROID_blob_cache's callbacks to be called, but it doesn't actually
+ * want any storing to disk to happen inside of the driver.
+ */
+ goto path_fail;
+#endif
+
char *path = disk_cache_generate_cache_dir(local);
if (!path)
goto path_fail;