summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorEric Engestrom <[email protected]>2017-09-08 10:49:45 +0100
committerEric Engestrom <[email protected]>2017-09-12 13:53:12 +0100
commitd861eb5fc2b0cce097efa88c8b783f118fd0eb9c (patch)
tree9337c07cba2507052dd653f394a4e3674db15cc8 /src/util
parent717fb6e4be9891cf77bb7ab43bda53ed62de747b (diff)
util/disk_cache: turn MESA_GLSL_CACHE_DISABLE into a boolean
Instead of setting based on set/unset, allow users to use boolean values. In the docs and tests, use `DISABLE=true` instead of `DISABLE=1` as it's clearer IMO. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/util')
-rw-r--r--src/util/disk_cache.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c
index 33e4dc8e7df..17913a913bd 100644
--- a/src/util/disk_cache.c
+++ b/src/util/disk_cache.c
@@ -40,6 +40,7 @@
#include "zlib.h"
#include "util/crc32.h"
+#include "util/debug.h"
#include "util/rand_xor.h"
#include "util/u_atomic.h"
#include "util/u_queue.h"
@@ -204,7 +205,7 @@ disk_cache_create(const char *gpu_name, const char *timestamp,
goto fail;
/* At user request, disable shader cache entirely. */
- if (getenv("MESA_GLSL_CACHE_DISABLE"))
+ if (env_var_as_boolean("MESA_GLSL_CACHE_DISABLE", false))
goto fail;
/* Determine path for cache based on the first defined name as follows: