diff options
Diffstat (limited to 'src/amd/vulkan')
-rw-r--r-- | src/amd/vulkan/radv_pipeline.c | 13 | ||||
-rw-r--r-- | src/amd/vulkan/radv_pipeline_cache.c | 7 | ||||
-rw-r--r-- | src/amd/vulkan/radv_private.h | 3 |
3 files changed, 15 insertions, 8 deletions
diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index 093940b69c2..228fdf4ab07 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -153,7 +153,8 @@ radv_pipeline_compile(struct radv_pipeline *pipeline, if (pipeline->gs_copy_shader) { pipeline->gs_copy_shader = - radv_pipeline_cache_insert_shader(cache, + radv_pipeline_cache_insert_shader(pipeline->device, + cache, gs_copy_sha1, pipeline->gs_copy_shader, gs_copy_code, @@ -166,8 +167,10 @@ radv_pipeline_compile(struct radv_pipeline *pipeline, ralloc_free(nir); if (variant) - variant = radv_pipeline_cache_insert_shader(cache, sha1, variant, - code, code_size); + variant = radv_pipeline_cache_insert_shader(pipeline->device, + cache, sha1, + variant, code, + code_size); if (code) free(code); @@ -290,11 +293,11 @@ radv_tess_pipeline_compile(struct radv_pipeline *pipeline, ralloc_free(tcs_nir); if (tes_variant) - tes_variant = radv_pipeline_cache_insert_shader(cache, tes_sha1, tes_variant, + tes_variant = radv_pipeline_cache_insert_shader(pipeline->device, cache, tes_sha1, tes_variant, tes_code, tes_code_size); if (tcs_variant) - tcs_variant = radv_pipeline_cache_insert_shader(cache, tcs_sha1, tcs_variant, + tcs_variant = radv_pipeline_cache_insert_shader(pipeline->device, cache, tcs_sha1, tcs_variant, tcs_code, tcs_code_size); if (tes_code) 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); diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h index 3a78778a695..79ac295a0fd 100644 --- a/src/amd/vulkan/radv_private.h +++ b/src/amd/vulkan/radv_private.h @@ -327,7 +327,8 @@ radv_create_shader_variant_from_pipeline_cache(struct radv_device *device, const unsigned char *sha1); 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); |