I'm using the exact same code to capture frames from video and render then through Metal, but while it works when I run on my iOS devices, when I run the code on my Mac I get a cryptic error.
CVMetalTextureCacheCreateTextureFromImage is returning kCVReturnError. Is there a way to get a better error description? Usually Apple error messages are pretty good.
I tried posting a link to the full project & relevant source files, but it's currently waiting for moderation.
After reading though the headers again, I did miss somehting.
I set the pixel format on the AVCaptureVideoDataOutput object, but neglected to set kCVPixelBufferMetalCompatibilityKey to true.
With kCVPixelBufferMetalCompatibilityKey set to true in the object's videoSettings, it's now grabbing the texture correctly.