Do Fullscreen Optimizations Affect Input Latency?

Everything about latency. This section is mainly user/consumer discussion. (Peer-reviewed scientific discussion should go in Laboratory section). Tips, mouse lag, display lag, game engine lag, network lag, whole input lag chain, VSYNC OFF vs VSYNC ON, and more! Input Lag Articles on Blur Busters.
User avatar
RealNC
Site Admin
Posts: 4424
Joined: 24 Dec 2013, 18:32
Contact:

Re: Do Fullscreen Optimizations Affect Input Latency?

Post by RealNC » 28 Sep 2024, 17:38

bumbeen wrote:
28 Sep 2024, 17:31
by definition if the gpu is not scanning out the game to its own plane or display there will be additional latency, no? There's something between the gpu and the screen unless you're using FSE or MPO
With FSO only one plane is used, since there's nothing else visible on the screen. MPO (= multiple plains) is not needed.
SteamGitHubStack Overflow
The views and opinions expressed in my posts are my own and do not necessarily reflect the official policy or position of Blur Busters.

bumbeen
Posts: 90
Joined: 25 Apr 2023, 14:35

Re: Do Fullscreen Optimizations Affect Input Latency?

Post by bumbeen » 28 Sep 2024, 18:59

RealNC wrote:
28 Sep 2024, 17:38

With FSO only one plane is used, since there's nothing else visible on the screen. MPO (= multiple plains) is not needed.
thanks for clarifying that. I must have been mixing up overlay scenario with non overlay scenario

User avatar
Gias
Posts: 41
Joined: 26 Nov 2021, 16:37

Re: Do Fullscreen Optimizations Affect Input Latency?

Post by Gias » 14 Oct 2024, 05:19

you don't need MPOs to bypass dwm composition with a game's borderless window mode either as long as it has engaged directflip/independent flip optimizations. typically directlflip/independent flip can happen with a flip model swapchain while the game's window covers the whole screen without scaling/stretching and as long as there isn't something external on top of the game (overlays that inject into the game are fine). otherwise you'd need MPOs...

with FSO, your game believes that it is running in fullscreen exclusive (at least if the game has a fullscreen exclusive option), but Windows, behind the scenes, has the game running in borderless windowed mode using a flip model swapchain; in d3d9ex that would be with the flipex swap effect and in dxgi (d3d10/d3d11/d3d12) that would be with the flip sequential or flip discard swap effect along with at least 2 buffers and a few other considerations...

(well FSE isn't actually supported in d3d12, but if "SetFullscreenState(true)" it set by the developer... then the d3d12 app can engage an "eFSE" mode that's essentially FSO)

technically FSO uses a borderless window that covers the whole screen, is using a flip model swapchain, and is on the INACTIVEMOBODY z-band, while most apps / external windows are on the DESKTOP z-band... which is lower (than the z-band for FSO) and is why those apps / external windows don't get to be on top of a game running with FSO.

however, at least gamebar widgets, the windows volume overlay, and presentmon widgets are actually on a higher z-band than FSO and is why that stuff can show up on top of games running with FSO. in those cases, you'd ideally have 2+ MPOs available to prevent your game from getting stuck with a composed flip presentation (dwm composition would be back at least while the external stuff is on top of the game)

also i believe the "activate windows" watermark is on the GENUINE_WINDOWS z-band, which is also higher than the z-band used by games running with FSO, and so, yep, not activating your windows could also result in higher latency / worse performance because of the "activate windows" watermark putting the game in a composed flip presentation...

granted you'd absolutely need MPOs for windowed games that don't cover the whole screen if you want them to engage directflip/independent flip optimizations... whereas FSO already covers the whole screen, so don't have to worry about that part at least...

the following site talks a bit about z-order and bands for those curious:

https://blog.adeltax.com/window-z-order-in-windows-10/

User avatar
RealNC
Site Admin
Posts: 4424
Joined: 24 Dec 2013, 18:32
Contact:

Re: Do Fullscreen Optimizations Affect Input Latency?

Post by RealNC » 14 Oct 2024, 06:58

Gias wrote:
14 Oct 2024, 05:19
granted you'd absolutely need MPOs for windowed games that don't cover the whole screen if you want them to engage directflip/independent flip optimizations... whereas FSO already covers the whole screen, so don't have to worry about that part at least...
I believe it's the other way around? For MPOs to work, you need a flip swapchain. If you have that, then MPOs can work. Windows 11 forcing even non-fullscreen windowed mode to use a flip swapchain is so that MPOs can be used.
SteamGitHubStack Overflow
The views and opinions expressed in my posts are my own and do not necessarily reflect the official policy or position of Blur Busters.

User avatar
Gias
Posts: 41
Joined: 26 Nov 2021, 16:37

Re: Do Fullscreen Optimizations Affect Input Latency?

Post by Gias » 14 Oct 2024, 08:58

RealNC wrote:
14 Oct 2024, 06:58
Gias wrote:
14 Oct 2024, 05:19
granted you'd absolutely need MPOs for windowed games that don't cover the whole screen if you want them to engage directflip/independent flip optimizations... whereas FSO already covers the whole screen, so don't have to worry about that part at least...
I believe it's the other way around? For MPOs to work, you need a flip swapchain. If you have that, then MPOs can work. Windows 11 forcing even non-fullscreen windowed mode to use a flip swapchain is so that MPOs can be used.
well i said "directflip/independent flip optimizations"

(the app has basically engaged that when it's using independent flip for presentation. you can normally see that with Intel's Presentmon)

https://learn.microsoft.com/en-us/windo ... directflip

but yep the app needs to be using a flip model swapchain before it can engage directflip/independent flip optimizations. in that bit you quoted i was saying that MPOs would be needed for directflip/independent flip optimizations (independent flip for presentation; as opposed to being stuck with a composed flip presentation) if the game's window doesn't cover the whole screen...

and, well, honestly i didn't feel like also mentioning there that flip model is needed first, but yeah that's true.

technically all d3d12 games already use fiip model swapchains though, and at least some d3d11 and d3d9ex games as well... but for those that don't... we'd need to force it yeah. SK may do it for d3d10/d3d11 (by default) and for d3d9ex (not enabled by default), and windows 11 and rtss may do it for d3d10/d3d11 (not enabled by default in the case of rtss at least... and i believe windows 11's optimizations for windowed games also wasn't enabled by default for me last time i clean installed windows 11. maybe it'd be different now. i guess i'll see how it is next time i clean install windows 11 again).

edit-

technically MPOs with 9ex flip model are more limited... :(

or at least that was the case last i checked, but i highly doubt that has changed since then.

like this worked (getting independent flip presentation with d3d9ex while having gamebar widgets on top and with the game's window resolution being less than the desktop resolution):


Image

but if i decreased the game's window resolution just a bit more... it'd result in the game's presentation switching to composed flip despite having 4 MPO planes

whereas with dxgi flip model i was able to retain independent fip presentation with a much smaller game window (while having MPOs of course)
Last edited by Gias on 14 Oct 2024, 19:14, edited 1 time in total.

User avatar
RealNC
Site Admin
Posts: 4424
Joined: 24 Dec 2013, 18:32
Contact:

Re: Do Fullscreen Optimizations Affect Input Latency?

Post by RealNC » 14 Oct 2024, 14:14

Gias wrote:
14 Oct 2024, 08:58
technically MPOs with 9ex flip model are more limited... :(

or at least that was the case last i checked, but i highly doubt that has changed since then.

like this worked (getting independent flip presentation with d3d9ex while having gamebar widgets on top and with the game's window resolution being less than the desktop resolution):
Don't know about d3d9ex specifically, but in general, for DX9 to work well in borderless, I have to use dgVoodoo2 and change the flip model like this:

2024_10_14_110_Kleki.png
2024_10_14_110_Kleki.png (80.39 KiB) Viewed 4882 times
SteamGitHubStack Overflow
The views and opinions expressed in my posts are my own and do not necessarily reflect the official policy or position of Blur Busters.

User avatar
Gias
Posts: 41
Joined: 26 Nov 2021, 16:37

Re: Do Fullscreen Optimizations Affect Input Latency?

Post by Gias » 14 Oct 2024, 18:54

RealNC wrote:
14 Oct 2024, 14:14
Gias wrote:
14 Oct 2024, 08:58
technically MPOs with 9ex flip model are more limited... :(

or at least that was the case last i checked, but i highly doubt that has changed since then.

like this worked (getting independent flip presentation with d3d9ex while having gamebar widgets on top and with the game's window resolution being less than the desktop resolution):
Don't know about d3d9ex specifically, but in general, for DX9 to work well in borderless, I have to use dgVoodoo2 and change the flip model like this:


2024_10_14_110_Kleki.png
ah yeah i like dgvoodoo2, especially after dege added the flip model options in 2022 for dxgi flip model, and yep that gives me better MPO capabilities compared to when the game was using 9ex flip model.

for d3d9/d3d9ex, i typically go with one of these options:

A) use special k and enable sk's d3d9ex/flipex overrides

B) use dgvoodoo with dgvoodoo's flip_discard or flip_sequential

C) use dxvk + nvidia's or amd's dxgi interop swapchain for vulkan

option A won't give us dxgi hdr... but can get it with options B and C

and well at least we could still use nvidia's RTX HDR with flip model through d3d9ex/flipex

d3d9ex games that natively (on their own) use flipex for 9ex flip model are very rare... i only know of 4

and technically flipex is only supported with d3d9ex. with regular d3d9 games, FSO actually changes FSE d3d9 games to borderless fullscreen d3d9ex and has them use the flipex swap effect for independent flip presentation on a higher z-band above the desktop.

for proper windowed/borderless d3d9 / d3d9ex games running on the desktop z-band (using the game's windowed/borderless option instead of FSE / FSO), we can try to force flipex with special k using the following in sk's config for the game:

Code: Select all

[Render.D3D9]
ForceD3D9Ex=true
EnableFlipEx=true
EnableTextureMods=false
some games may also require having EnableTextureMods=true to avoid some graphical issues

and local sk injection (sk as d3d9.dll in the game's folder), instead of the global sk injection method, may be needed for some games

this approach won't work with all d3d9/d3d9ex games... so those sk overrides are not enabled by default, but i've gotten it working with most of my d3d9 / d3d9ex games.

the dgvoodoo and dxvk options also have their pros and cons with compatibility...

anyway, at least we got more than one option we can try.

Post Reply