dxvk icon indicating copy to clipboard operation
dxvk copied to clipboard

Fixing swapchain breakage : Append WS_POPUP to HWND

Open skart0196-AMD opened this issue 3 months ago • 1 comments

Hey DXVK team, my apologies for the delayed response to https://github.com/GPUOpen-Drivers/AMD-Gfx-Drivers/issues/57 .

The swapchain breakage on Windows is because DXGI requires that HWND's have the following properties

DXGI ERROR: IDXGIFactory::CreateSwapChain: The specified output window has a style that is incompatible with DXGI. Output windows must have at least one of: WS_POPUP WS_BORDER WS_CAPTION WS_SYSMENU WS_MAXIMIZEBOX WS_MINIMIZEBOX WS_THICKFRAME WS_EX_CLIENTEDGE WS_EX_CONTEXTHELP WS_EX_DLGMODALFRAME WS_EX_TOOLWINDOW WS_EX_WINDOWEDGE or not have WS_EX_TOPMOST

It may be some time before our fix makes it downstream. In the meantime, it might be easier to workaround this in DXVK by appending a required style (like WS_POPUP) for applications that don't meet these requirements.

For FalloutNV in particular, the black screens were due to having WS_EX_TOPMOST set without any other required styles. I'm not sure if the other bug reports you had are all the same issue but it may be worth ensuring HWND compliance.

skart0196-AMD avatar Oct 08 '25 23:10 skart0196-AMD

Thanks for the heads-up.

For now I'm very hesitant to change window styles since any changes in that area are unfortunately prone to introducing other kinds of regressions, and we don't have a very good understanding of native behaviour (D3D9 in this case) either. This is definitely going to need some more investigation on our end.

doitsujin avatar Oct 09 '25 14:10 doitsujin