From d53b3adaea19ffa7f22a63436af3adbb6d4ea428 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Sat, 4 Jan 2020 21:09:58 +0000 Subject: [PATCH] [d3d9] Remove incorrect error returns SetDialogBoxMode The Microsoft docs for this are incorrect based on my tests of all the described edge-cases. https://docs.microsoft.com/en-us/windows/win32/api/d3d9/nf-d3d9-idirect3ddevice9-setdialogboxmode --- src/d3d9/d3d9_swapchain.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/d3d9/d3d9_swapchain.cpp b/src/d3d9/d3d9_swapchain.cpp index a31f3caba..26e467063 100644 --- a/src/d3d9/d3d9_swapchain.cpp +++ b/src/d3d9/d3d9_swapchain.cpp @@ -402,18 +402,10 @@ namespace dxvk { HRESULT D3D9SwapChainEx::SetDialogBoxMode(bool bEnableDialogs) { - if (bEnableDialogs) { - if (m_presentParams.BackBufferFormat != D3DFMT_X1R5G5B5 && - m_presentParams.BackBufferFormat != D3DFMT_R5G6B5 && - m_presentParams.BackBufferFormat != D3DFMT_X8R8G8B8) - return D3DERR_INVALIDCALL; - - if (m_presentParams.SwapEffect == D3DSWAPEFFECT_DISCARD) - return D3DERR_INVALIDCALL; - - if (m_presentParams.Flags & D3DPRESENTFLAG_LOCKABLE_BACKBUFFER) - return D3DERR_INVALIDCALL; - } + // https://docs.microsoft.com/en-us/windows/win32/api/d3d9/nf-d3d9-idirect3ddevice9-setdialogboxmode + // The MSDN documentation says this will error out under many weird conditions. + // However it doesn't appear to error at all in any of my tests of these + // cases described in the documentation. m_dialogChanged = m_dialog != bEnableDialogs; m_dialog = bEnableDialogs;