metallib: Error reading module: Invalid bitcode signature

Deadly 提交于 2019-12-11 14:02:35

问题


I have following Filter.metal file

#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;
    }

}}

I am trying to compile it with:

xcrun metal -fcikernel Filter.metal -o Filter.air
xcrun metallib -cikernel Filter.air -o Filter.metallib

But I get this Error:

metallib: Error reading module: Invalid bitcode signature

I am trying to create a custom CIFIlter and I followed this: https://medium.com/@shu223/core-image-filters-with-metal-71afd6377f4 tutorial.

The command lines I got from https://developer.apple.com/metal/MetalCIKLReference6.pdf.

How can I compile my file without this error?


回答1:


The response from Bug reporter was:

Apple Developer Relations
October 29 2018, 4:08 AM

Engineering has the following feedback for you:

The documentation is incorrect here. One should add a “-c” to force an AIR file, i.e.,

xcrun metal -fcikernel MyKernels.metal -c -o MyKernels.air

We are now closing this bug report.

If you have questions or comments about the resolution, please update your bug report with that information so we can respond.



来源:https://stackoverflow.com/questions/52992783/metallib-error-reading-module-invalid-bitcode-signature

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!