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

Introduce vsync-based and overcommitment throttling to metal redrawer on macOS #753

Merged
merged 12 commits into from
Jul 10, 2023

Conversation

elijah-semyonov
Copy link
Contributor

@elijah-semyonov elijah-semyonov commented Jul 7, 2023

Refactored version of #710

elijah-semyonov and others added 3 commits July 7, 2023 13:34
* Add overcommitment prevention mechanism

* Replace hardcoded value with CAMetalLayer property

* Update skiko/src/awtMain/objectiveC/macos/MetalContextHandler.mm

Co-authored-by: Igor Demin <igordmn@users.noreply.github.com>

---------

Co-authored-by: Igor Demin <igordmn@users.noreply.github.com>
@elijah-semyonov elijah-semyonov changed the title Introduce vsync based throttling to metal redrawer on macOS Introduce vsync-based and overcommitment throttling to metal redrawer on macOS Jul 7, 2023
NSScreen *_displayLinkScreen;
CVDisplayLinkRef _displayLink;
NSConditionLock *_vsyncConditionLock;
volatile atomic_bool _displayLinkOk;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems we can get rid of this variable. Check this PR, is everything ok in it?

Copy link
Collaborator

@igordmn igordmn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of comments, and it is good to merge, thanks!

@elijah-semyonov elijah-semyonov self-assigned this Jul 10, 2023
* Remove _displayLinkOk

* Discussions

* Fix build
@elijah-semyonov elijah-semyonov merged commit 39fb88f into master Jul 10, 2023
@elijah-semyonov elijah-semyonov deleted the elijah.semyonov/macos-metal-vsync-throttling branch July 10, 2023 12:10
@m-sasha
Copy link
Member

m-sasha commented Jul 10, 2023

Hurray!

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.

3 participants