iOS/Metal

Issue: CVMetalTextureCacheCreateTextureFromImage returns -6660

0zerohyun 2022. 1. 6. 15:20

 

let attrs = [kCVPixelBufferCGImageCompatibilityKey: kCFBooleanTrue,
             kCVPixelBufferCGBitmapContextCompatibilityKey: kCFBooleanTrue,
             kCVPixelBufferMetalCompatibilityKey: kCFBooleanTrue] as CFDictionary


CVPixelBufferCreate(kCFAllocatorDefault,
                            width,
                            height,
                            kCVPixelFormatType_32BGRA,
                            attrs,
                            &pixelBuffer)

kCVPixelBufferMetalCompatibilityKey: kCFBooleanTrue를 추가하여 해결

 

https://coderedirect.com/questions/292378/cvmetaltexturecachecreatetexturefromimage-returns-6660-on-macos-10-13