The Metal framework function MTLLibrary.makeDefaultLibrary()
loads “your app’s default Metal library.” However, it doesn’t specify where it finds this default library.
When I build an example project, like marzvrover/Performing-Calculations-on-a-GPU, Xcode builds the file default.metallib
. This file needs to be present or makeDefaultLibrary()
fails.
Therefore, when I build my own project from the command line, I link my compiled shaders together into default.metallib
. Yet, makeDefaultLibrary()
is still failing.
How does Metal decide where the default library lives? Why can it be found by a binary compiled by Xcode, but not my program compiled with swiftc
?