mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-22 16:54:27 +01:00
[d3d9] Only unbind in EndScene if the game cleared the binding
This commit is contained in:
parent
85215b10d6
commit
72c86b8229
@ -1616,15 +1616,22 @@ namespace dxvk {
|
|||||||
|
|
||||||
m_flags.clr(D3D9DeviceFlag::InScene);
|
m_flags.clr(D3D9DeviceFlag::InScene);
|
||||||
|
|
||||||
// D3D9 resets the internally bound vertex buffers and index buffer in EndScene.
|
// D3D9 resets the internally bound vertex buffers and index buffer in EndScene if they were unbound in the meantime.
|
||||||
// We have to ignore unbinding those buffers because of Operation Flashpoint Red River,
|
// We have to ignore unbinding those buffers because of Operation Flashpoint Red River,
|
||||||
// so we should also clear the bindings here, to avoid leaks.
|
// so we should also clear the bindings here, to avoid leaks.
|
||||||
EmitCs([](DxvkContext* ctx) {
|
if (m_state.indices == nullptr) {
|
||||||
ctx->bindIndexBuffer(DxvkBufferSlice(), VK_INDEX_TYPE_UINT32);
|
EmitCs([](DxvkContext* ctx) {
|
||||||
for (uint32_t i = 0; i < DxvkLimits::MaxNumVertexBindings; i++) {
|
ctx->bindIndexBuffer(DxvkBufferSlice(), VK_INDEX_TYPE_UINT32);
|
||||||
ctx->bindVertexBuffer(i, DxvkBufferSlice(), 0);
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
for (uint32_t i = 0; i < DxvkLimits::MaxNumVertexBindings; i++) {
|
||||||
|
if (m_state.vertexBuffers[i].vertexBuffer == nullptr) {
|
||||||
|
EmitCs([cIndex = i](DxvkContext* ctx) {
|
||||||
|
ctx->bindVertexBuffer(cIndex, DxvkBufferSlice(), 0);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
|
||||||
return D3D_OK;
|
return D3D_OK;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user