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 metal frame rendering when more than one display is connected #5847

Merged
merged 2 commits into from
Jun 18, 2023

Conversation

peppy
Copy link
Member

@peppy peppy commented Jun 18, 2023

Incorporating @ILW8's work (ppy/veldrid#20) to more correctly provide hinting to metal as to where the window is running on the host, which allows better selection of refresh rates and display timings.

Tested on single display macbook and dual display mac pro (with two external displays). In these cases, I'm not noticing anything working better than before, but it runs fine without any signs of regression.

Closes #5828.

@peppy peppy requested a review from frenzibyte June 18, 2023 05:35
@peppy peppy added the next-release Pull requests which are almost there label Jun 18, 2023
Copy link
Member

@frenzibyte frenzibyte left a comment

Choose a reason for hiding this comment

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

Looks solid. Timing of calling the function is no longer needed now with ppy/veldrid@7beb127, since if the game is running on multithreaded and the function happened to be called while the draw thread is in the middle of a frame, then the only effect would be blocking the input thread until the draw frame finishes processing (unlike previously where it would pretty much deadlock).

We should eventually have better IRenderer API for this one way or another, but there's only one usage of this right now so let's get it in for the time being.

Tested to work with my setup, the rate of the display link callback (indicated by the draw FPS) changes correctly based on the display (as opposed to master where it gets stuck on the display the game was first launched in).

@frenzibyte frenzibyte merged commit 86e4ba9 into ppy:master Jun 18, 2023
@peppy peppy deleted the update-veldrid branch June 21, 2023 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next-release Pull requests which are almost there size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CVDisplayLink set to wrong display
2 participants