mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-06 20:58:37 +01:00
Fix for saving vertex shader constants with a StateBlock
Co-authored-by: aroztkow <aneta.roztkowska@intel.com>
This commit is contained in:
parent
0fc5c84e7b
commit
0462454d2b
2 changed files with 14 additions and 8 deletions
|
@ -470,14 +470,9 @@ namespace dxvk {
|
|||
m_captures.flags.set(D3D9CapturedStateFlag::VertexShader);
|
||||
m_captures.flags.set(D3D9CapturedStateFlag::VsConstants);
|
||||
|
||||
for (uint32_t i = 0; i < m_parent->GetVertexConstantLayout().floatCount / 32; i++)
|
||||
m_captures.vsConsts.fConsts.dword(i) = std::numeric_limits<uint32_t>::max();
|
||||
|
||||
for (uint32_t i = 0; i < m_parent->GetVertexConstantLayout().intCount / 32; i++)
|
||||
m_captures.vsConsts.iConsts.dword(i) = std::numeric_limits<uint32_t>::max();
|
||||
|
||||
for (uint32_t i = 0; i < m_parent->GetVertexConstantLayout().bitmaskCount; i++)
|
||||
m_captures.vsConsts.bConsts.dword(i) = std::numeric_limits<uint32_t>::max();
|
||||
m_captures.vsConsts.fConsts.setN(m_parent->GetVertexConstantLayout().floatCount);
|
||||
m_captures.vsConsts.iConsts.setN(m_parent->GetVertexConstantLayout().intCount);
|
||||
m_captures.vsConsts.bConsts.setN(m_parent->GetVertexConstantLayout().boolCount);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -320,6 +320,17 @@ namespace dxvk::bit {
|
|||
return get(idx);
|
||||
}
|
||||
|
||||
constexpr void setN(uint32_t bits) {
|
||||
uint32_t fullDwords = bits / 32;
|
||||
uint32_t offset = bits % 32;
|
||||
|
||||
for (size_t i = 0; i < fullDwords; i++)
|
||||
m_dwords[i] = std::numeric_limits<uint32_t>::max();
|
||||
|
||||
if (offset > 0)
|
||||
m_dwords[fullDwords] = (1u << offset) - 1;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
uint32_t m_dwords[Dwords];
|
||||
|
|
Loading…
Add table
Reference in a new issue