diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index f25d89a9165..f6b41b79de6 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -2983,7 +2983,8 @@ VkResult anv_CreateDevice( if (result != VK_SUCCESS) goto fail_clear_value_bo; - anv_pipeline_cache_init(&device->default_pipeline_cache, device, true); + anv_pipeline_cache_init(&device->default_pipeline_cache, device, + true /* cache_enabled */, false /* external_sync */); anv_device_init_blorp(device); diff --git a/src/intel/vulkan/anv_pipeline_cache.c b/src/intel/vulkan/anv_pipeline_cache.c index 2c6ecb7fbc9..ac2326c6648 100644 --- a/src/intel/vulkan/anv_pipeline_cache.c +++ b/src/intel/vulkan/anv_pipeline_cache.c @@ -280,11 +280,13 @@ sha1_compare_func(const void *sha1_a, const void *sha1_b) void anv_pipeline_cache_init(struct anv_pipeline_cache *cache, struct anv_device *device, - bool cache_enabled) + bool cache_enabled, + bool external_sync) { vk_object_base_init(&device->vk, &cache->base, VK_OBJECT_TYPE_PIPELINE_CACHE); cache->device = device; + cache->external_sync = external_sync; pthread_mutex_init(&cache->mutex, NULL); if (cache_enabled) { @@ -538,11 +540,9 @@ VkResult anv_CreatePipelineCache( if (cache == NULL) return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY); - cache->external_sync = - (pCreateInfo->flags & VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT_EXT); - anv_pipeline_cache_init(cache, device, - device->physical->instance->pipeline_cache_enabled); + device->physical->instance->pipeline_cache_enabled, + pCreateInfo->flags & VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT_EXT); if (pCreateInfo->initialDataSize > 0) anv_pipeline_cache_load(cache, diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index e31e6a6579e..9500b41dead 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -1253,7 +1253,8 @@ struct anv_pipeline_bind_map; void anv_pipeline_cache_init(struct anv_pipeline_cache *cache, struct anv_device *device, - bool cache_enabled); + bool cache_enabled, + bool external_sync); void anv_pipeline_cache_finish(struct anv_pipeline_cache *cache); struct anv_shader_bin *