mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-26 08:15:59 +03:00
[PR #990] [MERGED] videoout: Make present thread realtime on macOS. #1866
Labels
No labels
Bloodborne
bug
contributor wanted
documentation
enhancement
frontend
good first issue
help wanted
linux
pull-request
question
release
verification progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/shadPS4#1866
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/shadps4-emu/shadPS4/pull/990
Author: @squidbus
Created: 9/19/2024
Status: ✅ Merged
Merged: 9/19/2024
Merged by: @raphaelthegreat
Base:
main← Head:present-realtime📝 Commits (1)
243f8b5videoout: Make present thread realtime on macOS.📊 Changes
3 files changed (+50 additions, -2 deletions)
View changed files
📝
src/common/thread.cpp(+43 -0)📝
src/common/thread.h(+3 -0)📝
src/core/libraries/videoout/driver.cpp(+4 -2)📄 Description
Adds a helper to set up threads with real-time scheduling, and uses it in
videooutfor the present thread to make sure the sleep timing for v-blanks is as accurate as possible. This fixes issues on macOS where presenting is too slow due to inaccurate sleep timing. I've also extended the v-blank period out to nanoseconds to make it more precise since it was actually running slightly too fast after fixing the sleep times; this may need further tuning to the exact v-blank period of the PS4, but for now it's just set for 60 FPS.Note that the real-time scheduling helper is only implemented for macOS currently. If any other platforms need it in the future, it can be implemented for them as well, but I don't have the knowledge necessary to implement this for all platforms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.