From 457826a83b801c6a4687714998a7f606f084be4c Mon Sep 17 00:00:00 2001 From: Wollnashorn Date: Fri, 6 Jan 2023 16:52:41 +0100 Subject: [PATCH] video_core/vulkan: Fixed loading of Vulkan driver pipeline cache The header size of the Vulkan driver pipeline cache files was incorrectly in PipelineCache::LoadVulkanPipelineCache, for which the pipeline cache wasn't read correctly and got invalidated on each load. --- src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index 013b42cf8d..7e69b11d8f 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp @@ -793,7 +793,8 @@ vk::PipelineCache PipelineCache::LoadVulkanPipelineCache(const std::filesystem:: return create_pipeline_cache(0, nullptr); } - const size_t cache_size = static_cast(end) - magic_number.size(); + static constexpr size_t header_size = magic_number.size() + sizeof(cache_version); + const size_t cache_size = static_cast(end) - header_size; std::vector cache_data(cache_size); file.read(cache_data.data(), cache_size);