diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp index e821e19d9..2ae8e0704 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -4328,6 +4328,10 @@ namespace dxvk { if (unlikely((Flags & (D3DLOCK_DISCARD | D3DLOCK_NOOVERWRITE)) == (D3DLOCK_DISCARD | D3DLOCK_NOOVERWRITE))) Flags &= ~D3DLOCK_DISCARD; + // Tests show that D3D9 drivers ignore DISCARD when the device is lost. + if (unlikely(m_deviceLostState != D3D9DeviceLostState::Ok)) + Flags &= ~D3DLOCK_DISCARD; + auto& desc = *(pResource->Desc()); if (unlikely(!desc.IsLockable)) @@ -4808,6 +4812,10 @@ namespace dxvk { if (desc.Usage & D3DUSAGE_DYNAMIC) Flags &= ~D3DLOCK_DONOTWAIT; + // Tests show that D3D9 drivers ignore DISCARD when the device is lost. + if (unlikely(m_deviceLostState != D3D9DeviceLostState::Ok)) + Flags &= ~D3DLOCK_DISCARD; + // We only bounds check for MANAGED. // (TODO: Apparently this is meant to happen for DYNAMIC too but I am not sure // how that works given it is meant to be a DIRECT access..?)