-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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: Initial support for vulkan on macOS ( MoltenVK ) #12583
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sweet!
I'm only a little concerned that it would now no longer build without the manually built dylib present.
Do you think we could either autodetect its presence and turn off VK_USE_PLATFORM_METAL_EXT for example, or maybe supply a precompiled dylib as a submodule or something? What might be best?
It's important for the build user experience that checking out and building is smooth.
One problem is that #define VK_USE_PLATFORM_METAL_EXT is guarded by I have zero knowledge about iOS programming. Any contribution is welcome. |
I can change this to PPSSPP_PLATFORM_MAC, if desired. |
Oh right it's a dylib not a lib... then things should be fine even when not present indeed. Both builds seem to still pass, so I don't know if you need to change that preprocessor check, but it might still be a good idea. |
So this is a little odd. I built Moltenvk:
The last line of the output was You'd think PPSSPP should be able to find it there, but it doesn't. It did however work copying it to /usr/local/lib indeed. Anyway, happy to merge this, but seems I was wrong in the other issue that we don't need to care about swizzle anymore, this is from running Wipeout Pure:
|
We use libMoltenVK.dylib, not the framework
Yes I also encountered this error for some games, thus I marked this PR highly experimental ;) Have no idea how to resolve it though... |
We simply have to convert that texture to another supported format. Might be able to reuse the path we have to work around the lack of support for the 16-bit formats on Windows 7 / DX11. |
Add support for iOS ( completely untested ) And found more info about VK_FORMAT_B4G4R4A4_UNORM_PACK16: KhronosGroup/MoltenVK#204 |
I have no idea how to do this. Would you mind merging my PR first and then work around this issue? |
Yeah, sure, I'm not expecting you to take care of that :) I will deal with it soon. |
Hm, by the way, do you know if we need to do anything to make it use Metal 3, as opposed to Metal 1 or 2? I have no idea how versioning works in Metal-land.... |
Sorry, but isn't it chosen by MoltenVK internally? |
Hm, right, most probably. Was curious because Metal 3 is supposed to fix that swizzle issue and it does not seem to be enabled on my (old) macbook pro, maybe it doesn't support it (or it's just a secondary error of the texture format not being supported). |
Metal level is dependent on macOS version;
To force software swizzle you use the following export
That or compile MoltenVK from source and force swizzle |
Tested but it doesn't work for me. Just found this And this But the log for my device reads
Seems no luck for me :( |
I'll open a new issue for the swizzle thing. |
This PR tries to
address #10654 -implement a highlyexperimentalbuggyvulkanMoltenVK support on modern macOS.To test it:
make macos
is enough. Or use the official --outdated-- homebrew versionbrew install molten-vk
MoltenVK/macOS/dynamic/libMoltenVK.dylib
( orPackage/Release/MoltenVK/dylib/macOS/libMoltenVK.dylib
for higher version ) to/usr/local/lib
or somewhere else that PPSSPP can find it. If use homebrew, skip this.Tested on macOS 10.15.2 (19C57)