mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-31 14:52:11 +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
|
// Discard caches of unsupported versions
|
||||||
if (curHeader.version != 2 && curHeader.version != 3) {
|
if (curHeader.version < 2 || curHeader.version > newHeader.version) {
|
||||||
Logger::warn("DXVK: State cache out of date");
|
Logger::warn("DXVK: State cache version not supported");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -307,8 +307,10 @@ namespace dxvk {
|
|||||||
DxvkStateCacheEntry entry;
|
DxvkStateCacheEntry entry;
|
||||||
|
|
||||||
if (readCacheEntry(ifile, entry)) {
|
if (readCacheEntry(ifile, entry)) {
|
||||||
if (curHeader.version == 2)
|
switch (curHeader.version) {
|
||||||
convertEntryV2(entry);
|
case 2: convertEntryV2(entry); /* fall through */
|
||||||
|
case 3: convertEntryV3(entry); /* fall through */
|
||||||
|
}
|
||||||
|
|
||||||
size_t entryId = m_entries.size();
|
size_t entryId = m_entries.size();
|
||||||
m_entries.push_back(entry);
|
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() {
|
void DxvkStateCache::workerFunc() {
|
||||||
env::setThreadName("dxvk-shader");
|
env::setThreadName("dxvk-shader");
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ namespace dxvk {
|
|||||||
*/
|
*/
|
||||||
struct DxvkStateCacheHeader {
|
struct DxvkStateCacheHeader {
|
||||||
char magic[4] = { 'D', 'X', 'V', 'K' };
|
char magic[4] = { 'D', 'X', 'V', 'K' };
|
||||||
uint32_t version = 3;
|
uint32_t version = 4;
|
||||||
uint32_t entrySize = sizeof(DxvkStateCacheEntry);
|
uint32_t entrySize = sizeof(DxvkStateCacheEntry);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -213,6 +213,9 @@ namespace dxvk {
|
|||||||
bool convertEntryV2(
|
bool convertEntryV2(
|
||||||
DxvkStateCacheEntry& entry) const;
|
DxvkStateCacheEntry& entry) const;
|
||||||
|
|
||||||
|
bool convertEntryV3(
|
||||||
|
DxvkStateCacheEntry& entry) const;
|
||||||
|
|
||||||
void workerFunc();
|
void workerFunc();
|
||||||
|
|
||||||
void writerFunc();
|
void writerFunc();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user