Skip to content
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

Improve frameSkipper and FrameHistory #7014

Merged
merged 3 commits into from
Jul 31, 2023
Merged

Improve frameSkipper and FrameHistory #7014

merged 3 commits into from
Jul 31, 2023

Conversation

pixelflinger
Copy link
Collaborator

  • Improve fence-based timer query emulation
  • Fix off-by-one in FrameSkipper
  • Improve FrameSkipper performance on GLES/Android

It now uses the fence for the start time and end time, leading to much
more accurate timings. We also use a single atomic variable instead of
two.
The frame latency specified was off-by-one, i.e. a value of 1 meant a
latency of 2. The default was 2, which meant 3. Also it wasn't possible
to specify the max latency of 4, which would OOB.
We get rid of the backend's HwSync object because on all platforms
but GL it was implemented just like a HwFence. We now use HwFence 
instead.

On GL platforms though, HwFence doesn't exist natively it is instead
provided by the Platform. In that case, we emulate it as with GLSync
objects -- the emulation incurs some latency that can cause frames
to be skipped.

On Android and platforms that provide the Fence functionality, there is
no such issue.

This change improves significantly frame pacing on Android.
@pixelflinger pixelflinger merged commit 98a2b8f into main Jul 31, 2023
8 checks passed
@pixelflinger pixelflinger deleted the ma/frameskipper branch July 31, 2023 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants