protonscr

Mixed Flip/Blt presenters on same HWND flicker

dxvkopen
doitsujin/dxvk#5314 · opened 2025-11-06 by clshortfuse · updated 2025-11-06 · 3 comments · github
Cclshortfuse 2025-11-06 github

Software information

Dual DX9Ex present and DX11Present on same HWND on DXVK causes flickering between presenters

System information

N / A

Apitrace file(s)

N / A

Log files

N / A

Hi, everyone! I'm the author of https://github.com/clshortfuse/renodx and to support HDR in DX9 games, I do the following:

  • Upgrade DX9 to DX9Ex
  • Create DX11 Device
  • Create DX11 Swapchain with Flip Model
  • Create DX11 shared resources
  • Clone DX9 swapchain buffer
  • On DX9 swapchain write, write to clone
  • On DX9 present, copy clone to shared DX11 resource and call DX11 Present

This actually works well in Windows (and works similarly with OpenGL => DX11). There is a problem in that I am relying on the following Windows behavior (emphasis mine):

Use flip model in an HWND that is not also targeted by other APIs, including DXGI bitblt presentation model, other versions of Direct3D, or GDI. Because bitblt model maintains an additional copy of the surface, you can add GDI and other Direct3D contents to the same HWND through piecemeal updates from Direct3D and GDI. When you use the flip model, only Direct3D content in flip model swap chains that the runtime passes to DWM are visible. The runtime ignores all other bitblt model Direct3D or GDI content updates.

https://learn.microsoft.com/en-us/windows/win32/direct3ddxgi/dxgi-flip-model

Basically, when a HWND has a DXGI Flip Model presenter, any other blt models effectively are blocked/null-op'd. I have reports (don't have a device to confirm) that with DXVK both the DX9 and DX11 layer both try to paint the same window causing flickering. Analyzing the code, it seems any special consideration for this honestly awkward setup doesn't seem to exist.

I'd imagine tagging a HWND would be a solution though I'd hope adding support for this doesn't become too difficult. Whether falls into the scope of the project is ultimately up to you (it's a weird mix of DWM and DXGI), but I thought I'd at least bring it to your attention.

Ddoitsujin maintainer 2025-11-06 github

Yes, we don't really support this. Wine does a bunch of stuff to make this sort-of work in that it can mux multiple Vulkan swapchains onto the same window and display the most recently presented swapchain, but honestly I really don't want to deal with any of this garbage. It's not an intended use case.

Ddoitsujin maintainer 2025-11-06 github

FWIW even on Wine this probably won't work because presentation to the Vulkan swapchains from different D3D devices can happen out-of-order with DXVK for performance reasons.

Cclshortfuse 2025-11-06 github

@doitsujin That's entirely fair. Thanks for giving it consideration. I think blocking the DX9/OpenGL present calls would work, so there's probably more we can do from our side.

Nothing extracted yet.