summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_pipeline_cache.c
diff options
context:
space:
mode:
authorKristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>2016-03-04 15:03:23 -0800
committerKristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>2016-03-05 13:54:24 -0800
commit34326f46dfe1511529363b4ab46477f04d3e1574 (patch)
treec83f31e0f54ce8df75787713f9fd7bba17d103e2 /src/intel/vulkan/anv_pipeline_cache.c
parentf2b37132cb6a804b958d2e1dff17e7d77e430b96 (diff)
downloadexternal_mesa3d-34326f46dfe1511529363b4ab46477f04d3e1574.zip
external_mesa3d-34326f46dfe1511529363b4ab46477f04d3e1574.tar.gz
external_mesa3d-34326f46dfe1511529363b4ab46477f04d3e1574.tar.bz2
anv: Turn pipeline cache on by default
Move the environment variable check to cache creation time so we block both lookups and uploads if it's turned off.
Diffstat (limited to 'src/intel/vulkan/anv_pipeline_cache.c')
-rw-r--r--src/intel/vulkan/anv_pipeline_cache.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/intel/vulkan/anv_pipeline_cache.c b/src/intel/vulkan/anv_pipeline_cache.c
index f7a1e1c..62dbe3e 100644
--- a/src/intel/vulkan/anv_pipeline_cache.c
+++ b/src/intel/vulkan/anv_pipeline_cache.c
@@ -54,7 +54,8 @@ anv_pipeline_cache_init(struct anv_pipeline_cache *cache,
/* We don't consider allocation failure fatal, we just start with a 0-sized
* cache. */
- if (cache->hash_table == NULL)
+ if (cache->hash_table == NULL ||
+ !env_var_as_boolean("ANV_ENABLE_PIPELINE_CACHE", true))
cache->table_size = 0;
else
memset(cache->hash_table, 0xff, byte_size);
@@ -299,7 +300,7 @@ anv_pipeline_cache_upload_kernel(struct anv_pipeline_cache *cache,
map->sampler_count * sizeof(struct anv_pipeline_binding));
map->sampler_to_descriptor = p;
- if (sha1 && env_var_as_boolean("ANV_ENABLE_PIPELINE_CACHE", false)) {
+ if (sha1) {
assert(anv_pipeline_cache_search_unlocked(cache, sha1,
NULL, NULL) == NO_KERNEL);