1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-14 04:29:15 +01:00

[d3d9] Reject 2 BeginScene + EndScene without Begin

This commit is contained in:
Georg Lehmann 2021-07-25 00:45:53 +02:00 committed by Joshie
parent 6071e998fd
commit 09e5939502
2 changed files with 16 additions and 0 deletions

View File

@ -1360,13 +1360,27 @@ namespace dxvk {
// Some games don't even call them.
HRESULT STDMETHODCALLTYPE D3D9DeviceEx::BeginScene() {
D3D9DeviceLock lock = LockDevice();
if (unlikely(m_flags.test(D3D9DeviceFlag::InScene)))
return D3DERR_INVALIDCALL;
m_flags.set(D3D9DeviceFlag::InScene);
return D3D_OK;
}
HRESULT STDMETHODCALLTYPE D3D9DeviceEx::EndScene() {
D3D9DeviceLock lock = LockDevice();
if (unlikely(!m_flags.test(D3D9DeviceFlag::InScene)))
return D3DERR_INVALIDCALL;
FlushImplicit(true);
m_flags.clr(D3D9DeviceFlag::InScene);
return D3D_OK;
}

View File

@ -71,6 +71,8 @@ namespace dxvk {
ValidSampleMask,
DirtyDepthBounds,
DirtyPointScale,
InScene,
};
using D3D9DeviceFlags = Flags<D3D9DeviceFlag>;