Having pored over the WWDC Video and slides, I am trying to get a CIFilter using a metal program to work. I have everything working with a Core Image Kernel Language version, but even a simple pass-through CIColorKernel only passes black ;-(
I have verified that the metal code is compiled and the libraries are linked, and in fact, [CIColorKernel kernelWithFunctionName:fromMetalLibraryData:error] returns what appears to be a perfectly good kernel, and the filter output image succeeds and even shows the filter in the image description ( CI processing stack). But it is black.
Here's the metal code for the filter:
#include <metal_stdlib>
using namespace metal;
#include <CoreImage/CoreImage.h>
extern "C" { namespace coreimage {
float4 ColorBands( sample_t src); // xcode complains without a prototype...
float4 ColorBands( sample_t src) {
return src.rgba;//float4(1.0, 0.2, 0.8,1.0)
}
} } // extern C, coreimage namespace
I have adapted the venerable RosyWriter sample to use a CIFilter subclass in place of the Rosy color just to verify the problem. This is using the latest (beta3) iOS 11 on a 12.9" iPad Pro. I haven't found any other samples that use the new CIKernel metal funtionality, so it may be that there's something simple i'm overlooking, or it may just not work.
Thanks in advance for any ideas or answers!