Contents

init(mtlTexture:commandBuffer:)

Creates a render destination based on a Metal texture.

Declaration

init(mtlTexture texture: any MTLTexture, commandBuffer: (any MTLCommandBuffer)?)

Parameters

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.

See Also

Creating a Render Destination