mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-20 10: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)
|
if (curHeader.version <= 4)
|
||||||
expectedSize = sizeof(DxvkStateCacheEntryV4);
|
expectedSize = sizeof(DxvkStateCacheEntryV4);
|
||||||
|
else if (curHeader.version <= 5)
|
||||||
|
expectedSize = sizeof(DxvkStateCacheEntryV5);
|
||||||
|
|
||||||
if (curHeader.entrySize != expectedSize) {
|
if (curHeader.entrySize != expectedSize) {
|
||||||
Logger::warn("DXVK: State cache entry size changed");
|
Logger::warn("DXVK: State cache entry size changed");
|
||||||
@ -391,6 +393,13 @@ namespace dxvk {
|
|||||||
convertEntryV2(v4);
|
convertEntryV2(v4);
|
||||||
|
|
||||||
return convertEntryV4(v4, entry);
|
return convertEntryV4(v4, entry);
|
||||||
|
} else if (version <= 5) {
|
||||||
|
DxvkStateCacheEntryV5 v5;
|
||||||
|
|
||||||
|
if (!readCacheEntryTyped(stream, v5))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return convertEntryV5(v5, entry);
|
||||||
} else {
|
} else {
|
||||||
return readCacheEntryTyped(stream, entry);
|
return readCacheEntryTyped(stream, entry);
|
||||||
}
|
}
|
||||||
@ -428,10 +437,10 @@ namespace dxvk {
|
|||||||
const DxvkStateCacheEntryV4& in,
|
const DxvkStateCacheEntryV4& in,
|
||||||
DxvkStateCacheEntry& out) const {
|
DxvkStateCacheEntry& out) const {
|
||||||
out.shaders = in.shaders;
|
out.shaders = in.shaders;
|
||||||
out.cpState = in.cpState;
|
|
||||||
out.format = in.format;
|
out.format = in.format;
|
||||||
out.hash = in.hash;
|
out.hash = in.hash;
|
||||||
|
|
||||||
|
out.cpState.bsBindingMask = in.cpState.bsBindingMask;
|
||||||
out.gpState.bsBindingMask = in.gpState.bsBindingMask;
|
out.gpState.bsBindingMask = in.gpState.bsBindingMask;
|
||||||
|
|
||||||
out.gpState.iaPrimitiveTopology = in.gpState.iaPrimitiveTopology;
|
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() {
|
void DxvkStateCache::workerFunc() {
|
||||||
env::setThreadName("dxvk-shader");
|
env::setThreadName("dxvk-shader");
|
||||||
|
|
||||||
|
@ -159,6 +159,10 @@ namespace dxvk {
|
|||||||
const DxvkStateCacheEntryV4& in,
|
const DxvkStateCacheEntryV4& in,
|
||||||
DxvkStateCacheEntry& out) const;
|
DxvkStateCacheEntry& out) const;
|
||||||
|
|
||||||
|
bool convertEntryV5(
|
||||||
|
const DxvkStateCacheEntryV5& in,
|
||||||
|
DxvkStateCacheEntry& out) const;
|
||||||
|
|
||||||
void workerFunc();
|
void workerFunc();
|
||||||
|
|
||||||
void writerFunc();
|
void writerFunc();
|
||||||
|
@ -52,7 +52,7 @@ namespace dxvk {
|
|||||||
*/
|
*/
|
||||||
struct DxvkStateCacheHeader {
|
struct DxvkStateCacheHeader {
|
||||||
char magic[4] = { 'D', 'X', 'V', 'K' };
|
char magic[4] = { 'D', 'X', 'V', 'K' };
|
||||||
uint32_t version = 5;
|
uint32_t version = 6;
|
||||||
uint32_t entrySize = sizeof(DxvkStateCacheEntry);
|
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
|
* \brief Version 4 state cache entry
|
||||||
*/
|
*/
|
||||||
struct DxvkStateCacheEntryV4 {
|
struct DxvkStateCacheEntryV4 {
|
||||||
DxvkStateCacheKey shaders;
|
DxvkStateCacheKey shaders;
|
||||||
DxvkGraphicsPipelineStateInfoV4 gpState;
|
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;
|
DxvkRenderPassFormat format;
|
||||||
Sha1Hash hash;
|
Sha1Hash hash;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user