-
-
Notifications
You must be signed in to change notification settings - Fork 516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(feat) Improve frame pacing, and only go framepaceless if the GPU is loaded #2642
Open
shinyquagsire23
wants to merge
1
commit into
alvr-org:master
Choose a base branch
from
shinyquagsire23:improve-frame-pacing
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
(feat) Improve frame pacing, and only go framepaceless if the GPU is loaded #2642
shinyquagsire23
wants to merge
1
commit into
alvr-org:master
from
shinyquagsire23:improve-frame-pacing
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zmerp
requested changes
Jan 18, 2025
Comment on lines
+510
to
+540
pub fn last_game_time_latency(&self) -> Option<Duration> { | ||
self.connection_context | ||
.statistics_manager | ||
.read() | ||
.as_ref() | ||
.map(|stats| stats.last_game_time_latency()) | ||
} | ||
|
||
pub fn last_compose_latency(&self) -> Option<Duration> { | ||
self.connection_context | ||
.statistics_manager | ||
.read() | ||
.as_ref() | ||
.map(|stats| stats.last_compose_latency()) | ||
} | ||
|
||
pub fn last_frame_present_interval(&self) -> Option<Duration> { | ||
self.connection_context | ||
.statistics_manager | ||
.read() | ||
.as_ref() | ||
.map(|stats| stats.last_frame_present_interval()) | ||
} | ||
|
||
pub fn display_interval(&self) -> Option<Duration> { | ||
self.connection_context | ||
.statistics_manager | ||
.read() | ||
.as_ref() | ||
.map(|stats| stats.display_interval()) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the API surface seems pretty big, maybe the timing logic should be moved inside the StatisticsManager?
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.