mirror of https://github.com/doitsujin/dxvk
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
|
@ -470,14 +470,9 @@ namespace dxvk {
|
||||||
m_captures.flags.set(D3D9CapturedStateFlag::VertexShader);
|
m_captures.flags.set(D3D9CapturedStateFlag::VertexShader);
|
||||||
m_captures.flags.set(D3D9CapturedStateFlag::VsConstants);
|
m_captures.flags.set(D3D9CapturedStateFlag::VsConstants);
|
||||||
|
|
||||||
for (uint32_t i = 0; i < m_parent->GetVertexConstantLayout().floatCount / 32; i++)
|
m_captures.vsConsts.fConsts.setN(m_parent->GetVertexConstantLayout().floatCount);
|
||||||
m_captures.vsConsts.fConsts.dword(i) = std::numeric_limits<uint32_t>::max();
|
m_captures.vsConsts.iConsts.setN(m_parent->GetVertexConstantLayout().intCount);
|
||||||
|
m_captures.vsConsts.bConsts.setN(m_parent->GetVertexConstantLayout().boolCount);
|
||||||
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();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -320,6 +320,17 @@ namespace dxvk::bit {
|
||||||
return get(idx);
|
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:
|
private:
|
||||||
|
|
||||||
uint32_t m_dwords[Dwords];
|
uint32_t m_dwords[Dwords];
|
||||||
|
|
Loading…
Reference in New Issue