mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-18 20:52:10 +01:00
[dxvk] Bump state cache format to version 4
Accomodates for the alpha test changes in D3D11.
This commit is contained in:
parent
93bd923c17
commit
7e1b0ef8e6
@ -289,8 +289,8 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
// Discard caches of unsupported versions
|
||||
if (curHeader.version != 2 && curHeader.version != 3) {
|
||||
Logger::warn("DXVK: State cache out of date");
|
||||
if (curHeader.version < 2 || curHeader.version > newHeader.version) {
|
||||
Logger::warn("DXVK: State cache version not supported");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -307,8 +307,10 @@ namespace dxvk {
|
||||
DxvkStateCacheEntry entry;
|
||||
|
||||
if (readCacheEntry(ifile, entry)) {
|
||||
if (curHeader.version == 2)
|
||||
convertEntryV2(entry);
|
||||
switch (curHeader.version) {
|
||||
case 2: convertEntryV2(entry); /* fall through */
|
||||
case 3: convertEntryV3(entry); /* fall through */
|
||||
}
|
||||
|
||||
size_t entryId = m_entries.size();
|
||||
m_entries.push_back(entry);
|
||||
@ -404,6 +406,16 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
|
||||
bool DxvkStateCache::convertEntryV3(
|
||||
DxvkStateCacheEntry& entry) const {
|
||||
// Semantics changed:
|
||||
// v3: Unused, always set to 0
|
||||
// v4: Alpha test compare op
|
||||
entry.gpState.xsAlphaCompareOp = VK_COMPARE_OP_ALWAYS;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void DxvkStateCache::workerFunc() {
|
||||
env::setThreadName("dxvk-shader");
|
||||
|
||||
|
@ -62,7 +62,7 @@ namespace dxvk {
|
||||
*/
|
||||
struct DxvkStateCacheHeader {
|
||||
char magic[4] = { 'D', 'X', 'V', 'K' };
|
||||
uint32_t version = 3;
|
||||
uint32_t version = 4;
|
||||
uint32_t entrySize = sizeof(DxvkStateCacheEntry);
|
||||
};
|
||||
|
||||
@ -213,6 +213,9 @@ namespace dxvk {
|
||||
bool convertEntryV2(
|
||||
DxvkStateCacheEntry& entry) const;
|
||||
|
||||
bool convertEntryV3(
|
||||
DxvkStateCacheEntry& entry) const;
|
||||
|
||||
void workerFunc();
|
||||
|
||||
void writerFunc();
|
||||
|
Loading…
x
Reference in New Issue
Block a user