diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp index 30a4a5b29ffd..e4525eba67ab 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -2615,7 +2615,7 @@ namespace dxvk { if (unlikely(!PrimitiveCount)) return S_OK; - PrepareDraw(PrimitiveType); + PrepareDraw(PrimitiveType, false); EmitCs([this, cPrimType = PrimitiveType, @@ -2652,7 +2652,7 @@ namespace dxvk { if (unlikely(!PrimitiveCount)) return S_OK; - PrepareDraw(PrimitiveType); + PrepareDraw(PrimitiveType, false); EmitCs([this, cPrimType = PrimitiveType, @@ -2688,7 +2688,7 @@ namespace dxvk { if (unlikely(!PrimitiveCount)) return S_OK; - PrepareDraw(PrimitiveType); + PrepareDraw(PrimitiveType, true); uint32_t vertexCount = GetVertexCount(PrimitiveType, PrimitiveCount); @@ -2740,7 +2740,7 @@ namespace dxvk { if (unlikely(!PrimitiveCount)) return S_OK; - PrepareDraw(PrimitiveType); + PrepareDraw(PrimitiveType, true); uint32_t vertexCount = GetVertexCount(PrimitiveType, PrimitiveCount); @@ -2827,7 +2827,7 @@ namespace dxvk { D3D9CommonBuffer* dst = static_cast(pDestBuffer)->GetCommonBuffer(); D3D9VertexDecl* decl = static_cast (pVertexDecl); - PrepareDraw(D3DPT_FORCE_DWORD); + PrepareDraw(D3DPT_FORCE_DWORD, true); if (decl == nullptr) { DWORD FVF = dst->Desc()->FVF; @@ -6454,7 +6454,7 @@ namespace dxvk { } - void D3D9DeviceEx::PrepareDraw(D3DPRIMITIVETYPE PrimitiveType) { + void D3D9DeviceEx::PrepareDraw(D3DPRIMITIVETYPE PrimitiveType, bool UpDraw) { if (unlikely(m_activeHazardsRT != 0 || m_activeHazardsDS != 0)) MarkRenderHazards(); @@ -6467,7 +6467,7 @@ namespace dxvk { for (uint32_t i = 0; i < caps::MaxStreams; i++) { auto* vbo = GetCommonBuffer(m_state.vertexBuffers[i].vertexBuffer); - if (vbo != nullptr && vbo->NeedsUpload()) + if (vbo != nullptr && vbo->NeedsUpload() && !UpDraw) FlushBuffer(vbo); } @@ -6483,7 +6483,7 @@ namespace dxvk { GenerateTextureMips(texturesToGen); auto* ibo = GetCommonBuffer(m_state.indices); - if (ibo != nullptr && ibo->NeedsUpload()) + if (ibo != nullptr && ibo->NeedsUpload() && !UpDraw) FlushBuffer(ibo); UpdateFog(); diff --git a/src/d3d9/d3d9_device.h b/src/d3d9/d3d9_device.h index 99a2a7439e5c..fccba4c717a5 100644 --- a/src/d3d9/d3d9_device.h +++ b/src/d3d9/d3d9_device.h @@ -895,7 +895,7 @@ namespace dxvk { uint32_t GetInstanceCount() const; - void PrepareDraw(D3DPRIMITIVETYPE PrimitiveType); + void PrepareDraw(D3DPRIMITIVETYPE PrimitiveType, bool UpDraw); template void BindShader(