.metal 文件中定义的 VertexFunction 和 FragmentFunction 运行良好,但是一旦我按照Apple 的文档指定编译器和链接器选项,它们就变成了 nil :Other Metal Compiler Flags 选项中的 -fcikernel 标志,以及用户定义设置中 MTLLINKER_FLAGS 中的 -cikernel flat。
我需要上面的设置用于带有 MSL(金属着色语言)的 cikernel。事实上,带有 Core Image Kernel Language 的 cikernel 在 12.0 中已弃用。
如何同时使用顶点/片段金属着色器和 MSL cikernel?
let library = self.device?.makeDefaultLibrary()!
let pipeLineDescriptor = MTLRenderPipelineDescriptor()
pipeLineDescriptor.vertexFunction=library.makeFunction(name: "myVertexShader")
pipeLineDescriptor.fragmentFunction=library.makeFunction(name: "myFragmentShader")