Merge pull request #9566 from Wollnashorn/vulkan-cache-header-fix

video_core/vulkan: Fixed loading of Vulkan driver pipeline cache
This commit is contained in:
Fernando S 2023-01-06 11:58:36 -05:00 committed by GitHub
commit 7ef897a277
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -793,7 +793,8 @@ vk::PipelineCache PipelineCache::LoadVulkanPipelineCache(const std::filesystem::
return create_pipeline_cache(0, nullptr); return create_pipeline_cache(0, nullptr);
} }
const size_t cache_size = static_cast<size_t>(end) - magic_number.size(); static constexpr size_t header_size = magic_number.size() + sizeof(cache_version);
const size_t cache_size = static_cast<size_t>(end) - header_size;
std::vector<char> cache_data(cache_size); std::vector<char> cache_data(cache_size);
file.read(cache_data.data(), cache_size); file.read(cache_data.data(), cache_size);