小编Ter*_*rus的帖子

metallib:错误读取模块:无效的位码签名

我有以下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获得的命令行。

如何编译没有此错误的文件?

c iphone ios metal

1
推荐指数
1
解决办法
442
查看次数

标签 统计

c ×1

ios ×1

iphone ×1

metal ×1