У меня есть следующий файл 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.
Как я могу скомпилировать файл без этой ошибки?
Я могу воспроизвести это с помощью Xcode 10 build 10A255.
Ответ от репортера об ошибке был:
Apple Developer Relations
October 29 2018, 4:08 AMEngineering 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.
Я могу воспроизвести это с помощью набора инструментов по умолчанию в Xcode 10 и Xcode 10.1 beta 4. Похоже на ошибку. Вам следует подумать о подаче сообщение об ошибке.