I’m currently writing some custom Core Image filters using Metal. For the sake of structure I want to put the different kernels into different
.metal
files with some common includes like you would do with “normal” source files.However, when the
metallib
tool bundles the different .air
files created by the Metal compiler into one .metallib
file, only the kernel functions defined in the first input .air
file given to metallib
are visible. Functions from the other .air
files don’t seem to be included. What’s the reason for this?I thought (as is the default compilation behavior for Metal files) all Metal sources get compiled into one library that is then used by every custom
CIFilter
class to instantiate their internal CIKernel
with the function they need.I now ended up compiling a
.metallib
file for each custom filter with custom build rules and copying all of them them into my framework within a custom build phase. This don’t seem to be the intended way…