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

macOS: Add MoltenVK Semaphore setting and fix performance regression #11550

Merged
merged 2 commits into from Feb 20, 2022

Conversation

nastys
Copy link
Contributor

@nastys nastys commented Feb 18, 2022

Since MoltenVK 1.1.7, due to synchronization issues making API calls randomly inaccurate, software emulation is used to simulate vkSemaphore, rather than MTLFence, when running under Rosetta or on NVIDIA. Software emulation causes screen tearing and a huge performance loss compared to MTLFence, with no real benefits for RPCS3.

This PR changes the default behaviour to MTLEvent + MTLFence (the former takes priority when not running under Rosetta or on NVIDIA), and adds a new option in the Debug tab to let developers change it at runtime.

Note that when using the loader library (libvulkan.1.dylib) instead of directly loading MoltenVK (libMoltenVK.dylib), the configuration cannot be set at runtime and the MVK_ALLOW_METAL_EVENTS and/or MVK_ALLOW_METAL_FENCES environment variables must be manually set instead.

@MSuih MSuih added the Driver: MoltenVK Open-source macOS Vulkan driver label Feb 18, 2022
@nastys nastys changed the title macOS: Add MoltenVK Semaphore setting macOS: Add MoltenVK Semaphore setting and fix performance regression Feb 18, 2022
@nastys nastys force-pushed the mvkfences branch 3 times, most recently from dac90e2 to 541f4fd Compare February 18, 2022 11:57
@nastys nastys force-pushed the mvkfences branch 4 times, most recently from 069ee8a to 3aecec6 Compare February 18, 2022 15:06
rpcs3/Emu/RSX/VK/vkutils/device.cpp Show resolved Hide resolved
rpcs3/Emu/RSX/VK/vkutils/device.h Outdated Show resolved Hide resolved
rpcs3/Emu/RSX/VK/vkutils/device.cpp Show resolved Hide resolved
rpcs3/Emu/RSX/VK/vkutils/device.cpp Outdated Show resolved Hide resolved
rpcs3/rpcs3qt/tooltips.h Outdated Show resolved Hide resolved
@nastys nastys force-pushed the mvkfences branch 2 times, most recently from 1615648 to ce9d0fc Compare February 18, 2022 17:05
@Megamouse Megamouse merged commit 7801e83 into RPCS3:master Feb 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Driver: MoltenVK Open-source macOS Vulkan driver
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants