D3D9 Flip Model Upgrade
Upgrades Direct3D 9 games to D3D9Ex with a FLIPEX swap chain so windowed/borderless games can reach Independent Flip
Author: tria
Important: close the game before this mod gets disabled, updated or
reloaded. A game that runs with the mod keeps using the Direct3D 9Ex device
and the emulated textures, which only work while the mod is loaded, so unloading
the mod will most likely break or crash the game. That includes disabling the
mod, changing its process inclusion list, and mod updates that Windhawk
installs automatically in the background. If you play with this mod enabled,
consider turning off automatic updates for it. Changing the settings is fine,
they apply the next time the game creates or resets its device.
Direct3D 9 games that run windowed or borderless present with the legacy
blt model: every frame is copied and composed by DWM, which adds latency and
blocks VRR. Windows 11's "Optimizations for windowed games" only covers
DirectX 10/11, so D3D9 games are left behind.
This mod transparently creates the game's device as a Direct3D 9Ex device
with a D3DSWAPEFFECT_FLIPEX swap chain (the D3D9 flip model). Once the
game window covers the whole screen (borderless fullscreen), DWM can promote it
to Independent Flip, the same presentation path exclusive fullscreen uses.
How to enable the mod for a program
This mod doesn't target any process by default. In Windhawk, go to the mod's
"Advanced" tab and scroll down to "Custom process inclusion list". In that box,
put the filename of the game's .exe, then click "Save" and (re)start the game.
How to verify
Use PresentMon (or an overlay that
shows the presentation mode, such as Special K or RTSS). A windowed D3D9 game
normally shows Composed: Copy with GPU GDI. With the mod it should show
Hardware: Independent Flip or Hardware Composed: Independent Flip.
Independent Flip requires the game window to cover the entire monitor with
nothing drawn on top of it. Run the game in its borderless mode, or turn on
Force borderless fullscreen in the mod settings.
A game that is not DPI aware gets stretched by DWM on a scaled display, which
prevents Independent Flip as well. If that is the case, open the properties of
the game executable, and under Compatibility, Change high DPI settings, set the
high DPI scaling override to Application.
Exclusive fullscreen
Games running in exclusive fullscreen are left untouched by default: Windows'
Fullscreen Optimizations already give them flip presentation. Turn on Force
borderless fullscreen to convert them to an upgraded borderless window
instead.
Known limitations
- Back buffer multisampling (MSAA requested directly on the swap chain) isn't
supported by the flip model and is dropped. Use the Keep MSAA setting to
skip the upgrade for such games instead.
- Games that lock the back buffer (some screenshot/readback code) lose that
ability.
- Anything drawn into the game window with GDI disappears; the flip model only
shows the Direct3D content.
- Games relying on
D3DSWAPEFFECT_COPY keeping the previous frame's content
may flicker.
D3DPOOL_MANAGED doesn't exist in D3D9Ex, so managed textures are emulated
with a system memory texture plus a default pool copy, and managed buffers
are created in the default pool. The Ex device is also hidden from D3DX
(d3dx9_*.dll), which otherwise refuses to load managed textures. A few
games may misbehave or fail to reset their device after a resolution change.
Games that often lock or read back managed buffers may run slower.
- D3D9 replacements that don't use the system
d3d9.dll (DXVK, d3d9on12
wrappers) bypass this mod entirely.
- A Direct3D 9Ex device is never reported as lost. Games with logic that
depends on losing the device after Alt+Tab may misbehave.
- Textures restored by a state block are not tracked. If the game modifies
such a texture while it stays bound, the change shows up once the texture is
bound again.
- The flip model can only present to the device window. Games that present the
same swap chain to several windows will only draw to one of them.
- The flip model needs the game window for itself. An in-game overlay that
creates its own Direct3D device for the same window, such as the Steam
overlay, keeps working, but it draws on top of the game and that prevents
Independent Flip. Turn the overlay off to get the full effect.
- Games that create their device with mixed vertex processing aren't upgraded,
as their managed vertex buffers can't be emulated.
- Some games with anti-tamper protection hang or close with the mod enabled.
Turn on SafeHook for them, so that the mod doesn't hook
LoadLibraryExW
in kernelbase.dll. It hooks d3d9.dll either way.
- No guarantees of anti-cheat compatibility.
Enable the mod's logging (Advanced → Debug logging) to see exactly what was
changed and any failure codes.