我有以下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;
}
}}
我试图用以下内容编译它:
xcrun metal -fcikernel Filter.metal -o Filter.air
xcrun metallib -cikernel Filter.air -o Filter.metallib
但我知道这个错误:
metallib: Error reading module: Invalid bitcode signature
我正在尝试创建一个定制的CIFIlter,并且我遵循了以下内容:https://medium.com/@shu223/core-image-filters-with-metal-71afd6377f4教程。
我从https://developer.apple.com/metal/MetalCIKLReference6.pdf获得的命令行。
如何在没有此错误的情况下编译文件?
发布于 2018-10-29 07:56:49
Bug记者的回应是:
苹果开发者关系 2018年10月29日凌晨4:08 工程部有以下反馈: 这里的文档是不正确的。应该添加一个“-c”来强制使用AIR文件,即, xcrun -fcikernel MyKernels.metal -c -o MyKernels.air 我们现在关闭这个错误报告。 如果您对解决方案有疑问或评论,请用该信息更新您的错误报告,以便我们能够作出回应。
https://stackoverflow.com/questions/52992783
复制相似问题