Question on Windowed mode DWM-vsync

Everything about displays and monitors. 120Hz, 144Hz, 240Hz, 4K, 1440p, input lag, display shopping, monitor purchase decisions, compare, versus, debate, and more. Questions? Just ask!
Post Reply
jyg050
Posts: 2
Joined: 22 Sep 2021, 14:12

Question on Windowed mode DWM-vsync

Post by jyg050 » 22 Sep 2021, 14:19

Assume that VRR and vsync is off in these cases...

From what I understand, running a game in Windowed mode will result in Windows applying vsync to the game regardless of in-game or driver-level settings.

However, this seems to be the case even if the frame rate counter in the game is way above my screen's refresh rate.

E.g.,
If I have a 120 Hz monitor, running a game in windowed mode, and the fps counter says 180 fps -- since vsync from Windows DWM is on, it's essentially 120 fps vsync'd, right?

In this case, is the GPU still doing the same work to produce 180 fps? Where do the other 60 frames go? In exclusive fullscreen mode with vsync off, you might get marginal improvements in input lag, so you have SOME returns on having a frame rate above refresh rate, but in windowed mode (with DWM vsync), is there any point? I'm guessing that in this situation, the user might as well limit the game frame rate to 120 fps. Is there something I'm missing?

Also, if this is indeed the case, why doesn't DWM vsync cap the in-game frame rate the same way that fullscreen traditional vsync does? Is this just a limitation of how it works? I'm imagining a situation where people are playing in windowed mode 500 fps and not realizing that it could just be a complete waste.

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

Re: Question on Windowed mode DWM-vsync

Post by RealNC » 22 Sep 2021, 20:01

It used to be simple a couple years ago. Now it's not.

In the past, windowed mode with vsync OFF in the game or in the driver control panel would mean that the game was running without vsync, but DWM would always vsync its own frames. So basically it would work very similar to fast sync (nvidia) and enhanced sync (amd). That is, game runs without vsync internally, but DWM grabs the latest frame available from the game and presents that with vsync.

Now there's another possibility. It is possible to get vsync OFF in DWM in windowed mode. It depends on your GPU, the driver, the Windows version and the game... It's like a maze. There's a new feature called "MPO" (short for "multiplane overlay") that modern W10 versions have, which can completely bypass DWM even in windowed mode. But it's not clear when that happens exactly and what the requirements are.

If you see tearing in windowed mode, then it's a safe bet that MPO is used.
jyg050 wrote:
22 Sep 2021, 14:19
Also, if this is indeed the case, why doesn't DWM vsync cap the in-game frame rate the same way that fullscreen traditional vsync does?
DWM caps itself, not the game. Applications and games are free to render as fast as they wish because they render frames into a "fake" screen. DWM will just pick the last frame from that fake screen and copy it into the real screen. But again, only if MPO isn't currently being used. If MPO is used, then DWM will basically create a "hole" of sorts on the screen where the game is then allowed to draw frames directly.
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.

jyg050
Posts: 2
Joined: 22 Sep 2021, 14:12

Re: Question on Windowed mode DWM-vsync

Post by jyg050 » 22 Sep 2021, 22:20

Ahh that makes perfect sense. Thanks for the quick response.

iceboy
Posts: 22
Joined: 04 Oct 2020, 14:22

Re: Question on Windowed mode DWM-vsync

Post by iceboy » 27 Sep 2021, 01:47

The syncing behavior is also affected by the graphics library. For example in Direct3D 9, when creating the device, PresentationInterval controls the syncing behavior in Windowed mode: when vsync is off, D3DPRESENT_INTERVAL_DEFAULT will wait for vsync at present, and D3DPRESENT_INTERVAL_IMMEDIATE will not.

Post Reply