I have one CoreImage Kernel with this namespace "extern "C" { namespace coreimage {" which I have imported like this
let kernel: CIColorKernel
let url = Bundle.main.url(forResource: "default", withExtension: "metallib")!
let data = try! Data(contentsOf: url)
kernel = try! CIColorKernel(functionName: "medianBlend", fromMetalLibraryData: data)
and three .metal files with this namespace "using namespace metal;" which I have imported like this:
let metalDevice = MTLCreateSystemDefaultDevice()!
let defaultLibrary = metalDevice.makeDefaultLibrary()!
I cant seem to find a way which compiles both into one library, even though I have tried it using the xcrun command line tool.
Can anyone help?