mirror of https://github.com/doitsujin/dxvk
[d3d9] Unbind buffers in EndScene & Reset
This commit is contained in:
parent
c9cea93b7b
commit
49b18f03fe
|
@ -481,6 +481,14 @@ namespace dxvk {
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Unbind all buffers that were still bound to the backend to avoid leaks.
|
||||||
|
EmitCs([](DxvkContext* ctx) {
|
||||||
|
ctx->bindIndexBuffer(DxvkBufferSlice(), VK_INDEX_TYPE_UINT32);
|
||||||
|
for (uint32_t i = 0; i < DxvkLimits::MaxNumVertexBindings; i++) {
|
||||||
|
ctx->bindVertexBuffer(i, DxvkBufferSlice(), 0);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
Flush();
|
Flush();
|
||||||
SynchronizeCsThread(DxvkCsThread::SynchronizeAll);
|
SynchronizeCsThread(DxvkCsThread::SynchronizeAll);
|
||||||
|
|
||||||
|
@ -1603,6 +1611,16 @@ namespace dxvk {
|
||||||
|
|
||||||
m_flags.clr(D3D9DeviceFlag::InScene);
|
m_flags.clr(D3D9DeviceFlag::InScene);
|
||||||
|
|
||||||
|
// D3D9 resets the internally bound vertex buffers and index buffer in EndScene.
|
||||||
|
// We have to ignore unbinding those buffers because of Operation Flashpoint Red River,
|
||||||
|
// so we should also clear the bindings here, to avoid leaks.
|
||||||
|
EmitCs([](DxvkContext* ctx) {
|
||||||
|
ctx->bindIndexBuffer(DxvkBufferSlice(), VK_INDEX_TYPE_UINT32);
|
||||||
|
for (uint32_t i = 0; i < DxvkLimits::MaxNumVertexBindings; i++) {
|
||||||
|
ctx->bindVertexBuffer(i, DxvkBufferSlice(), 0);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return D3D_OK;
|
return D3D_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue