1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-18 20:52:10 +01:00

[d3d9] Avoid unnecessary state block constant bits when not SWVPing

This commit is contained in:
Joshua Ashton 2019-12-17 03:01:17 +00:00 committed by Philip Rebohle
parent 312905e8a3
commit 78e4816fc0
2 changed files with 16 additions and 7 deletions

View File

@ -462,9 +462,14 @@ namespace dxvk {
m_captures.flags.set(D3D9CapturedStateFlag::VertexShader);
m_captures.flags.set(D3D9CapturedStateFlag::VsConstants);
m_captures.vsConsts.fConsts.setAll();
m_captures.vsConsts.iConsts.setAll();
m_captures.vsConsts.bConsts.setAll();
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();
}

View File

@ -309,8 +309,10 @@ namespace dxvk {
}
}
for (uint32_t i = 0; i < m_captures.vsConsts.bConsts.dwordCount(); i++)
dst->SetVertexBoolBitfield(i, m_captures.vsConsts.bConsts.dword(i), src->vsConsts.bConsts[i]);
if (m_captures.vsConsts.bConsts.any()) {
for (uint32_t i = 0; i < m_captures.vsConsts.bConsts.dwordCount(); i++)
dst->SetVertexBoolBitfield(i, m_captures.vsConsts.bConsts.dword(i), src->vsConsts.bConsts[i]);
}
}
if (m_captures.flags.test(D3D9CapturedStateFlag::PsConstants)) {
@ -330,8 +332,10 @@ namespace dxvk {
}
}
for (uint32_t i = 0; i < m_captures.psConsts.bConsts.dwordCount(); i++)
dst->SetPixelBoolBitfield(i, m_captures.psConsts.bConsts.dword(i), src->psConsts.bConsts[i]);
if (m_captures.psConsts.bConsts.any()) {
for (uint32_t i = 0; i < m_captures.psConsts.bConsts.dwordCount(); i++)
dst->SetPixelBoolBitfield(i, m_captures.psConsts.bConsts.dword(i), src->psConsts.bConsts[i]);
}
}
}