mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-18 13:54:16 +01:00
[dxvk] Bump state cache version to v6
This commit is contained in:
parent
e253183bc2
commit
a74eceaf46
@ -300,6 +300,8 @@ namespace dxvk {
|
||||
|
||||
if (curHeader.version <= 4)
|
||||
expectedSize = sizeof(DxvkStateCacheEntryV4);
|
||||
else if (curHeader.version <= 5)
|
||||
expectedSize = sizeof(DxvkStateCacheEntryV5);
|
||||
|
||||
if (curHeader.entrySize != expectedSize) {
|
||||
Logger::warn("DXVK: State cache entry size changed");
|
||||
@ -391,6 +393,13 @@ namespace dxvk {
|
||||
convertEntryV2(v4);
|
||||
|
||||
return convertEntryV4(v4, entry);
|
||||
} else if (version <= 5) {
|
||||
DxvkStateCacheEntryV5 v5;
|
||||
|
||||
if (!readCacheEntryTyped(stream, v5))
|
||||
return false;
|
||||
|
||||
return convertEntryV5(v5, entry);
|
||||
} else {
|
||||
return readCacheEntryTyped(stream, entry);
|
||||
}
|
||||
@ -428,10 +437,10 @@ namespace dxvk {
|
||||
const DxvkStateCacheEntryV4& in,
|
||||
DxvkStateCacheEntry& out) const {
|
||||
out.shaders = in.shaders;
|
||||
out.cpState = in.cpState;
|
||||
out.format = in.format;
|
||||
out.hash = in.hash;
|
||||
|
||||
out.cpState.bsBindingMask = in.cpState.bsBindingMask;
|
||||
out.gpState.bsBindingMask = in.gpState.bsBindingMask;
|
||||
|
||||
out.gpState.iaPrimitiveTopology = in.gpState.iaPrimitiveTopology;
|
||||
@ -480,6 +489,19 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
|
||||
bool DxvkStateCache::convertEntryV5(
|
||||
const DxvkStateCacheEntryV5& in,
|
||||
DxvkStateCacheEntry& out) const {
|
||||
out.shaders = in.shaders;
|
||||
out.gpState = in.gpState;
|
||||
out.format = in.format;
|
||||
out.hash = in.hash;
|
||||
|
||||
out.cpState.bsBindingMask = in.cpState.bsBindingMask;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void DxvkStateCache::workerFunc() {
|
||||
env::setThreadName("dxvk-shader");
|
||||
|
||||
|
@ -159,6 +159,10 @@ namespace dxvk {
|
||||
const DxvkStateCacheEntryV4& in,
|
||||
DxvkStateCacheEntry& out) const;
|
||||
|
||||
bool convertEntryV5(
|
||||
const DxvkStateCacheEntryV5& in,
|
||||
DxvkStateCacheEntry& out) const;
|
||||
|
||||
void workerFunc();
|
||||
|
||||
void writerFunc();
|
||||
|
@ -52,7 +52,7 @@ namespace dxvk {
|
||||
*/
|
||||
struct DxvkStateCacheHeader {
|
||||
char magic[4] = { 'D', 'X', 'V', 'K' };
|
||||
uint32_t version = 5;
|
||||
uint32_t version = 6;
|
||||
uint32_t entrySize = sizeof(DxvkStateCacheEntry);
|
||||
};
|
||||
|
||||
@ -103,13 +103,33 @@ namespace dxvk {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* \brief Version 5 compute pipeline state
|
||||
*/
|
||||
struct DxvkComputePipelineStateInfoV5 {
|
||||
DxvkBindingMask bsBindingMask;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* \brief Version 4 state cache entry
|
||||
*/
|
||||
struct DxvkStateCacheEntryV4 {
|
||||
DxvkStateCacheKey shaders;
|
||||
DxvkGraphicsPipelineStateInfoV4 gpState;
|
||||
DxvkComputePipelineStateInfo cpState;
|
||||
DxvkComputePipelineStateInfoV5 cpState;
|
||||
DxvkRenderPassFormat format;
|
||||
Sha1Hash hash;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* \brief Version 5 state cache entry
|
||||
*/
|
||||
struct DxvkStateCacheEntryV5 {
|
||||
DxvkStateCacheKey shaders;
|
||||
DxvkGraphicsPipelineStateInfo gpState;
|
||||
DxvkComputePipelineStateInfoV5 cpState;
|
||||
DxvkRenderPassFormat format;
|
||||
Sha1Hash hash;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user