(feat) Improve frame pacing, and only go framepaceless if the GPU is loaded #2642
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
So, there's two modes of frame pacing: Framepaceless and framepaced.
Framepaceless was changed so that it will only omit sleeps if:
Seems to be more stable in high-FPS games (and the overlay).
Framepaced was changed so that it will subtract the compositing latency from the vsync sleep. Sometimes if the GPU is starting to get fully loaded, the compositing latency will go up to ~5ms or so. This means that for example (assuming a 100Hz HMD):
For whatever reason, subtracting the compositing latency from the vsync sleep seems to agree more with SteamVR's frame pacing, and in nearing-display-frametime situations, seems to result in a less-thrashy graph. I think what happens is that if a game is taking 7ms to render and compositing takes 3-4ms, the client-side frame queue has an easier time absorbing the impact of 1-2ms variance on the next frame as opposed to the 10ms/0ms thrashing if it starts rounding. For even lower FPS games, SteamVR's frame pacing seems to take the wheel and the graphs get really flat.
I also think that the framepaced change basically makes the framepaceless change almost useless.