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

Update libMoltenVK.dylib to support M1 chips #13771

Closed
wants to merge 1 commit into from
Closed

Update libMoltenVK.dylib to support M1 chips #13771

wants to merge 1 commit into from

Conversation

Halo-Michael
Copy link
Contributor

@Halo-Michael Halo-Michael commented Dec 15, 2020

EDIT(hrydgard): Also adds new iOS MoltenVK. From new Vulkan SDK

@hrydgard
Copy link
Owner

Hm, I wonder why the iOS MoltenVK dylib is so huge? does it also contain x64 bits for simulator on old macs?

What do we do about signing? Should we instead use the static library approach?

@Halo-Michael
Copy link
Contributor Author

Programs built for iOS will always contain a lot of blank blocks. You can try to write a helloworld.c and compile it for iOS and macOS. Basically the size of the program built for iOS is about 56kb, and the size of the program built for macOS is about 1kb.
However, since iOS 10.3, 64-bit iOS devices have used apfs partitions as file partitions. Thanks to the characteristics of apfs, the blank space does not actually occupy the physical block of the hard disk at all, and can basically be understood as a kind of Similar to compression characteristics. Thanks to this feature, we actually don't need to care too much about these blank blocks in binaries.

@Halo-Michael
Copy link
Contributor Author

Halo-Michael commented Dec 15, 2020

Regarding codesign, the temporary method is to use a jailbroken device for testing. I have signed libMoltenVK.dylib for iOS with ldid, so if you use a jailbroken device to test it, it should be available directly.
If there is no jailbroken device, you can also find the cached PPSSPP.app location after running ppsspp into the device through xcode run for the first time, use the codesign command to sign the libMoltenVK.dylib file, and then re-run ppsspp into the device. Xcode tries to skip the compilation process, read the ppsspp program in the cache and reinstall it. At this time, you should be able to see the vulkan option in ppsspp.
However, these are temporary solutions. The correct way is to add libMoltenVK.dylib as a third-party library that needs to be linked into the xcode project, and then xcode will automatically sign it. This may require that the ppsspp main program is directly linked to the libMoltenVK.dylib file, and the CMakeFile file needs to be properly and correctly modified. Unfortunately, my current knowledge of CMake is extremely limited, and I don't know how to make such a modification. Another method is to statically compile libMoltenVK.a directly into the ppsspp main program, so that there is no need to sign. This also requires a lot of modifications to the source code.
I suggest that libMoltenVK.a is statically compiled into the main ppsspp program on macOS first, which may save a lot of work time.

My knowledge of English is also extremely limited, so the language support comes from Google Translate. If you have any sentences that are difficult to understand, please tell me, and I will try my best to change the language and elaborate again.

@hrydgard
Copy link
Owner

That was very easy to understand, thank you.

Yes we then need to either add it as a proper third-party library, or statically link it. It feels to me that both will take some research but the latter (statically link) will be less likely to go wrong once it works...

@Halo-Michael
Copy link
Contributor Author

About how to use codesign command:

  1. Use security find-identity -v -p codesigning to get all your certificates
  2. Well, I did not find a more reliable introduction website, and I can’t describe it easily, so I use pictures to show
    (}YGQ`QOZWYYC02F7NC@RR4
    %F1RGA97W(@JV83HX5I6{33
    Dylib does not need entitlements

@DamnBoi706
Copy link

So now is vulkan working properly in the latest build now?

@DamnBoi706
Copy link

imma try a couple different of games and iOS devices see if it would make any difference (with the latest build)

@Halo-Michael
Copy link
Contributor Author

So now is vulkan working properly in the latest build now?

Not really on iOS

@DamnBoi706
Copy link

so it is not functional right now?

@Panderner
Copy link
Contributor

@Halo-Michael why are you closing this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants