From d020f4451a3f6fb98ec36590f767f44e85dd51dc Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Sat, 21 Jan 2023 01:24:02 +0100 Subject: [PATCH] [dxvk] Invalidate all v16 cache files We were randomly writing bogus data in an irrecoverable way, so in order to not cause any problems for users, invalidate all caches created with this version. --- src/dxvk/dxvk_state_cache.cpp | 3 ++- src/dxvk/dxvk_state_cache_types.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dxvk/dxvk_state_cache.cpp b/src/dxvk/dxvk_state_cache.cpp index 534117ee..5bf9a7e4 100644 --- a/src/dxvk/dxvk_state_cache.cpp +++ b/src/dxvk/dxvk_state_cache.cpp @@ -496,7 +496,8 @@ namespace dxvk { } // Discard caches of unsupported versions - if (curHeader.version < 8 || curHeader.version > newHeader.version) { + if (curHeader.version < 8 || curHeader.version == 16 + || curHeader.version > newHeader.version) { Logger::warn("DXVK: State cache version not supported"); return false; } diff --git a/src/dxvk/dxvk_state_cache_types.h b/src/dxvk/dxvk_state_cache_types.h index 86d99a55..e5882593 100644 --- a/src/dxvk/dxvk_state_cache_types.h +++ b/src/dxvk/dxvk_state_cache_types.h @@ -60,7 +60,7 @@ namespace dxvk { */ struct DxvkStateCacheHeader { char magic[4] = { 'D', 'X', 'V', 'K' }; - uint32_t version = 16; + uint32_t version = 17; uint32_t entrySize = 0; /* no longer meaningful */ };