summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Wollnashorn2023-01-06 16:52:41 +0100
committerGravatar Wollnashorn2023-01-06 16:52:41 +0100
commit457826a83b801c6a4687714998a7f606f084be4c (patch)
treeec9212ad3c78eec08c43d505ff23f79da64beafc
parentMerge pull request #9535 from bylaws/master (diff)
downloadyuzu-457826a83b801c6a4687714998a7f606f084be4c.tar.gz
yuzu-457826a83b801c6a4687714998a7f606f084be4c.tar.xz
yuzu-457826a83b801c6a4687714998a7f606f084be4c.zip
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.
Diffstat (limited to '')
-rw-r--r--src/video_core/renderer_vulkan/vk_pipeline_cache.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
index 013b42cf8..7e69b11d8 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::
793 return create_pipeline_cache(0, nullptr); 793 return create_pipeline_cache(0, nullptr);
794 } 794 }
795 795
796 const size_t cache_size = static_cast<size_t>(end) - magic_number.size(); 796 static constexpr size_t header_size = magic_number.size() + sizeof(cache_version);
797 const size_t cache_size = static_cast<size_t>(end) - header_size;
797 std::vector<char> cache_data(cache_size); 798 std::vector<char> cache_data(cache_size);
798 file.read(cache_data.data(), cache_size); 799 file.read(cache_data.data(), cache_size);
799 800