init(mtlTexture:commandBuffer:)
Creates a render destination based on a Metal texture.
Declaration
init(mtlTexture texture: any MTLTexture, commandBuffer: (any MTLCommandBuffer)?)Parameters
- texture:
The Mtltexture object for rendering with Mtltexturetype of Type2d.
- commandBuffer:
An optional Mtlcommandbuffer to use for rendering to the Mtltexture destination.
Return Value
A CIRenderDestination object for rendering to a Metal buffer.
Discussion
Rendering to a MTLTexture-backed CIRenderDestination is supported by only MTLTexture-backed CIContext objects. The texture must have MTLTextureType of MTLTextureType.type2D.
The destination’s colorSpace property will default to a CGColorSpace created with sRGB, extendedSRGB, or genericGrayGamma2_2.