1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-03 04:24:11 +01:00

[d3d9] Captured NULL vertex declarations are not applied

This commit is contained in:
Georg Lehmann 2021-07-25 23:50:25 +02:00 committed by Joshie
parent 28a07ef445
commit 9162aa5fdf
2 changed files with 7 additions and 3 deletions

View File

@ -38,6 +38,9 @@ namespace dxvk {
HRESULT STDMETHODCALLTYPE D3D9StateBlock::Capture() {
if (m_captures.flags.test(D3D9CapturedStateFlag::VertexDecl))
SetVertexDeclaration(m_deviceState->vertexDecl.ptr());
ApplyOrCapture<D3D9StateFunction::Capture>();
return D3D_OK;
@ -46,6 +49,10 @@ namespace dxvk {
HRESULT STDMETHODCALLTYPE D3D9StateBlock::Apply() {
m_applying = true;
if (m_captures.flags.test(D3D9CapturedStateFlag::VertexDecl) && m_state.vertexDecl != nullptr)
m_parent->SetVertexDeclaration(m_state.vertexDecl.ptr());
ApplyOrCapture<D3D9StateFunction::Apply>();
m_applying = false;

View File

@ -174,9 +174,6 @@ namespace dxvk {
template <typename Dst, typename Src>
void ApplyOrCapture(Dst* dst, const Src* src) {
if (m_captures.flags.test(D3D9CapturedStateFlag::VertexDecl))
dst->SetVertexDeclaration(src->vertexDecl.ptr());
if (m_captures.flags.test(D3D9CapturedStateFlag::StreamFreq)) {
for (uint32_t stream = m_captures.streamFreq.dword(0); stream; stream &= stream - 1) {
uint32_t idx = bit::tzcnt(stream);