[d3d9] Validate depth and stencil clears

This commit is contained in:
WinterSnowfall 2024-12-09 21:43:53 +02:00
parent b1ad43145b
commit 9d205c7500
No known key found for this signature in database

View file

@ -1840,6 +1840,12 @@ namespace dxvk {
D3D9DeviceLock lock = LockDevice();
// D3DCLEAR_ZBUFFER and D3DCLEAR_STENCIL are invalid flags
// if there is no currently bound DS (which can be the autoDS)
if (unlikely(m_state.depthStencil == nullptr
&& (Flags & (D3DCLEAR_ZBUFFER | D3DCLEAR_STENCIL))))
return D3DERR_INVALIDCALL;
const auto& vp = m_state.viewport;
const auto& sc = m_state.scissorRect;