From 17b85accfbd6c7d1e62592476a6f647099967966 Mon Sep 17 00:00:00 2001 From: WinterSnowfall Date: Wed, 27 Nov 2024 11:16:24 +0200 Subject: [PATCH] [d3d9] Adjust device reset failure error codes --- src/d3d9/d3d9_device.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp index ebd92cb3fca..4cecd947c98 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -514,7 +514,8 @@ namespace dxvk { if (unlikely(m_losableResourceCounter.load() != 0 && !IsExtended() && m_d3d9Options.countLosableResources)) { Logger::warn(str::format("Device reset failed because device still has alive losable resources: Device not reset. Remaining resources: ", m_losableResourceCounter.load())); m_deviceLostState = D3D9DeviceLostState::NotReset; - return D3DERR_DEVICELOST; + // D3D8 returns D3DERR_DEVICELOST here, whereas D3D9 returns D3DERR_INVALIDCALL. + return m_isD3D8Compatible ? D3DERR_DEVICELOST : D3DERR_INVALIDCALL; } hr = ResetSwapChain(pPresentationParameters, nullptr);