MTKTextureLoader.newTexture fails to load 16-bit CGImages.
let path = "test.scnassets/test16.png" let image = UIImage(named: path)! let textureLoader = MTKTextureLoader(device: defaultDevice) let texture = try! textureLoader.newTexture(cgImage: image.cgImage!, options: [:])
Results in error:
Error Domain=MTKTextureLoaderErrorDomain Code=0 "Image decoding failed" UserInfo={NSLocalizedDescription=Image decoding failed, MTKTextureLoaderErrorKey=Image decoding failed}
Now my question is, if not like this, then how can I create a texture, manually, using a proper 16 bit pixel format.