hrydgard / ppsspp

A PSP emulator for Android, Windows, Mac and Linux, written in C++. Want to contribute? Join us on Discord at https://discord.gg/5NJB6dD or just send pull requests / issues. For discussion use the forums at forums.ppsspp.org.
https://www.ppsspp.org
Other
11.45k stars 2.19k forks source link

Mac DPI problem with Vulkan #19183

Open hrydgard opened 6 months ago

hrydgard commented 6 months ago

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.

schm1dtmac commented 4 weeks ago

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 commented 4 weeks ago

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...