How to get only 1 frame of latency with capped framerate and vsync?

Started by
12 comments, last by SoldierOfLight 6 years, 11 months ago

So using a waitable swap chain with a maximum frame latency of 1, I'm seeing 2 frames of latency (~20ms with a 100hz refresh rate). This is an improvement over 3 as previously.

When the window covers the screen, the present method changes from "Composed: Flip" to "Hardware: Independent Flip"; however, the latency remains ~20ms. Maybe I'm running into the aforementioned issue with frame latency? Is there a way for me to check?

Advertisement

Yep, that's the expected behavior I described. The only way to do better is to poll the frame statistics and only submit a new frame when the previous one is on screen.

I found the post in question and implemented it with frame statistics. It does work with just 1 frame of latency when the window covers the screen and there's nothing on top! This is promising. But having the framerate drop by half whenever these conditions aren't met is really nasty... Imagine someone using any kind of overlay while they are playing, how can we know? I guess I could keep track of the framerate and switch to a higher-latency method if it seems we're not rendering at a correct speed but this is getting complicated. I hope one of these two bugs (frame statistics in composed mode or extra latency in waitable swap chain) is fixed so it's possible to implement this relatively simply.

Note that a fullscreen exclusive swapchain in D3D11 can get a guaranteed 1 frame of latency using frame statistics, since it's guaranteed that it will never fall back to composition.

We are investigating fixing the frame latency semaphore to do what it's supposed to do, for all other desired scenarios.

This topic is closed to new replies.

Advertisement