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

Mac DPI problem with Vulkan #19183

Closed
hrydgard opened this issue May 25, 2024 · 3 comments · Fixed by #20011
Closed

Mac DPI problem with Vulkan #19183

hrydgard opened this issue May 25, 2024 · 3 comments · Fixed by #20011
Labels
Platform-specific (Mac OS X) User Interface PPSSPP's own user interface / UX
Milestone

Comments

@hrydgard
Copy link
Owner

It seems I get a higher DPI when running with GL than with Vulkan on my Mac - on Vulkan, we seem to be upscaling from a non-native resolution.

@hrydgard hrydgard added Platform-specific (Mac OS X) User Interface PPSSPP's own user interface / UX labels May 25, 2024
@hrydgard hrydgard added this to the v1.19.0 milestone May 25, 2024
@schm1dtmac
Copy link

schm1dtmac commented Nov 3, 2024

Had a quick mess around with this, this one-liner is a cheap fix that (in conjunction with removing any temp code in SDLMain.cpp to force the DPI scale to 1.0 on Mac Vulkan) sets the Metal DPI scale factors correctly in SDLCocoaMetalLayer.mm:
[[view layer] setContentsScale:[window backingScaleFactor]]; after setting the view layer on line 19.
Only issue is this doesn't update accordingly when, e.g. you move PPSSPP to a low-DPI external display or vice versa, or when you change macOS resolution between a high and low DPI mode for testing. Can't imagine a better solution for that than continuously polling for whether the backing scale factor has changed or not, and correcting the content scale accordingly.

@hrydgard
Copy link
Owner Author

hrydgard commented Nov 4, 2024

Hm, ok. Thanks for the one-liner! I think I'll mess around with an external display later and see if I can find a way to get notifications for the change, or something.. don't know how it's supposed to work on macOS...

hrydgard added a commit that referenced this issue Feb 20, 2025
Fixes #19183

Thanks to @schm1dtmac for the fix.

@shm1dtmac also mentions that this may have issues when moving the window between displays, but this should still be an improvement for most people.
@hrydgard
Copy link
Owner Author

I'm just getting in the straightforward fix for now. Will address multiple displays later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform-specific (Mac OS X) User Interface PPSSPP's own user interface / UX
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants