summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/compiler/glsl/tests/cache_test.c5
-rw-r--r--src/util/disk_cache.c7
2 files changed, 12 insertions, 0 deletions
diff --git a/src/compiler/glsl/tests/cache_test.c b/src/compiler/glsl/tests/cache_test.c
index 0ef05aacb26..8547141051d 100644
--- a/src/compiler/glsl/tests/cache_test.c
+++ b/src/compiler/glsl/tests/cache_test.c
@@ -388,6 +388,11 @@ main(void)
#ifdef ENABLE_SHADER_CACHE
int err;
+ /* While the shader cache is still experimental, this variable must
+ * be set or the cache does nothing.
+ */
+ setenv("MESA_GLSL_CACHE_ENABLE", "1", 1);
+
test_disk_cache_create();
test_put_and_get();
diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c
index 6de608c2e4a..551ceebd3b8 100644
--- a/src/util/disk_cache.c
+++ b/src/util/disk_cache.c
@@ -151,6 +151,13 @@ disk_cache_create(void)
if (getenv("MESA_GLSL_CACHE_DISABLE"))
goto fail;
+ /* As a temporary measure, (while the shader cache is under
+ * development, and known to not be fully functional), also require
+ * the MESA_GLSL_CACHE_ENABLE variable to be set.
+ */
+ if (!getenv("MESA_GLSL_CACHE_ENABLE"))
+ goto fail;
+
/* Determine path for cache based on the first defined name as follows:
*
* $MESA_GLSL_CACHE_DIR