diff --git a/src/vulkan/runtime/vk_device.c b/src/vulkan/runtime/vk_device.c index 9b95e319724..60af69b1faf 100644 --- a/src/vulkan/runtime/vk_device.c +++ b/src/vulkan/runtime/vk_device.c @@ -187,6 +187,19 @@ vk_device_init(struct vk_device *device, simple_mtx_init(&device->trace_mtx, mtx_plain); + vk_foreach_struct_const (ext, pCreateInfo->pNext) { + switch (ext->sType) { + case VK_STRUCTURE_TYPE_DEVICE_PIPELINE_BINARY_INTERNAL_CACHE_CONTROL_KHR: { + const VkDevicePipelineBinaryInternalCacheControlKHR *cache_control = (const void *)ext; + if (cache_control->disableInternalCache) + device->disable_internal_cache = true; + break; + } + default: + break; + } + } + return VK_SUCCESS; } diff --git a/src/vulkan/runtime/vk_device.h b/src/vulkan/runtime/vk_device.h index e20b259ba98..2a6d1d14338 100644 --- a/src/vulkan/runtime/vk_device.h +++ b/src/vulkan/runtime/vk_device.h @@ -267,6 +267,9 @@ struct vk_device { struct hash_table *swapchain_private; mtx_t swapchain_name_mtx; struct hash_table *swapchain_name; + + /* For VK_KHR_pipeline_binary */ + bool disable_internal_cache; }; VK_DEFINE_HANDLE_CASTS(vk_device, base, VkDevice, diff --git a/src/vulkan/runtime/vk_pipeline_cache.c b/src/vulkan/runtime/vk_pipeline_cache.c index 71471dd0239..c38855ac528 100644 --- a/src/vulkan/runtime/vk_pipeline_cache.c +++ b/src/vulkan/runtime/vk_pipeline_cache.c @@ -682,6 +682,7 @@ vk_common_CreatePipelineCache(VkDevice _device, struct vk_pipeline_cache_create_info info = { .pCreateInfo = pCreateInfo, + .skip_disk_cache = device->disable_internal_cache, }; cache = vk_pipeline_cache_create(device, &info, pAllocator); if (cache == NULL)