summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_pipeline_cache.c
diff options
context:
space:
mode:
authorBas Nieuwenhuizen <[email protected]>2017-09-25 05:47:25 +0200
committerBas Nieuwenhuizen <[email protected]>2017-09-25 15:36:19 +0200
commitbf0397b6f570754916b8e0253ac2b5f279b0a3b6 (patch)
tree552b1ea765d8cc359f3ec13a3a3e5ec495662496 /src/amd/vulkan/radv_pipeline_cache.c
parentbb66af95a7e13f433466f612eded97b01e48b6fc (diff)
Revert "Revert "radv: fallback to an in-memory cache when no pipline cache is provided""
I tested this 10 times with ./deqp-vk --deqp-case=dEQP-VK.texture.filtering.3d.formats.r4g4b4a4* and one full run of CTS, seems the issue is gone. Also reduces CTS runtime by 30% or so. Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_pipeline_cache.c')
-rw-r--r--src/amd/vulkan/radv_pipeline_cache.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/amd/vulkan/radv_pipeline_cache.c b/src/amd/vulkan/radv_pipeline_cache.c
index fa760f31eee..43176b6fdf8 100644
--- a/src/amd/vulkan/radv_pipeline_cache.c
+++ b/src/amd/vulkan/radv_pipeline_cache.c
@@ -162,6 +162,8 @@ radv_create_shader_variant_from_pipeline_cache(struct radv_device *device,
if (cache)
entry = radv_pipeline_cache_search(cache, sha1);
+ else
+ entry = radv_pipeline_cache_search(device->mem_cache, sha1);
if (!entry)
return NULL;
@@ -262,13 +264,14 @@ radv_pipeline_cache_add_entry(struct radv_pipeline_cache *cache,
}
struct radv_shader_variant *
-radv_pipeline_cache_insert_shader(struct radv_pipeline_cache *cache,
+radv_pipeline_cache_insert_shader(struct radv_device *device,
+ struct radv_pipeline_cache *cache,
const unsigned char *sha1,
struct radv_shader_variant *variant,
const void *code, unsigned code_size)
{
if (!cache)
- return variant;
+ cache = device->mem_cache;
pthread_mutex_lock(&cache->mutex);
struct cache_entry *entry = radv_pipeline_cache_search_unlocked(cache, sha1);