Skip to content

Commit

Permalink
[d3d9] Validate depth and stencil clears
Browse files Browse the repository at this point in the history
  • Loading branch information
WinterSnowfall authored and doitsujin committed Dec 10, 2024
1 parent d1abce3 commit 4dd0afe
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/d3d9/d3d9_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 4dd0afe

Please sign in to comment.