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

Better timer for better framepacing #325

Merged
merged 4 commits into from
Jun 28, 2023
Merged

Better timer for better framepacing #325

merged 4 commits into from
Jun 28, 2023

Conversation

Spodi
Copy link
Contributor

@Spodi Spodi commented Jun 26, 2023

New frame timing approach for DirectX renderer:

  • always use timer instead of relying on V-Sync
  • improved timer precision to minimize missed frames (also fixes Timer precision issues #299)
  • Sadly something I coudn't fix with that:
    If the window is on a secondary monitor that runs on a lower refresh rate than the primary, the rendering is also composed via DWM (Composed: Flip) and you're setting the FPS higer than your primary monitor: then it starts to stutter horribly. (This seems also happening with Sulu). But one shoudn't push the limiter higher up than their refresh rate with V-Sync on anyway. 😛

Thanks to Aemony and Kaldaien from Special K, who helped a lot with this.

Split off from #312, so testing things is hopefully easier.

Spodi and others added 4 commits June 26, 2023 18:13
Implemented idea from Kenix3#299.

Co-authored-by: Andon M. Coleman <Kaldaien@users.noreply.github.com>
Flush the immediate context before forcing a CPU-wait, otherwise the GPU might only start working when the SwapChain is presented.

Co-authored-by: Andon M. Coleman <Kaldaien@users.noreply.github.com>
@Kenix3 Kenix3 merged commit e05e094 into Kenix3:main Jun 28, 2023
@Spodi Spodi deleted the framepacing branch June 30, 2023 09:20
garrettjoecox added a commit to garrettjoecox/libultraship that referenced this pull request May 15, 2024
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.

Timer precision issues
2 participants