我有以下Filter.metal文件
#include <metal_stdlib>
using namespace metal;
#include <CoreImage/CoreImage.h> // includes CIKernelMetalLib.h
extern "C" { namespace coreimage {
float4 myColor(sample_t s) {
return s.grba;
}
}}
Run Code Online (Sandbox Code Playgroud)
我正在尝试将其编译为:
xcrun metal -fcikernel Filter.metal -o Filter.air
xcrun metallib -cikernel Filter.air -o Filter.metallib
Run Code Online (Sandbox Code Playgroud)
但是我得到这个错误:
metallib: Error reading module: Invalid bitcode signature
Run Code Online (Sandbox Code Playgroud)
我正在尝试创建自定义CIFIlter,我遵循以下步骤:https ://medium.com/@shu223/core-image-filters-with-metal-71afd6377f4 教程。
我从https://developer.apple.com/metal/MetalCIKLReference6.pdf获得的命令行。
如何编译没有此错误的文件?