Is it possible to pass MTLTexture to Metal Core Image Kernel? How can Metal resources be shared with Core Image?
You can simply initialize a CIImage
with the texture and pass that to the kernel:
let ciImage = CIImage(mtlTexture: texture)
The documentation also mentions what you need to do to let Core Image render into a Metal texture.
If you want to incorporate a Metal processing step into a Core Image pipeline instead, I recommend you check out CIImageProcessorKernel
.