Initializer

init(mtlTexture:commandBuffer:)

Creates a render destination based on a Metal texture.

Declaration

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

Parameters

texture

The MTLTexture object for rendering with MTLTextureType of MTLTextureType.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.

See Also

Creating a Render Destination

init(pixelBuffer: CVPixelBuffer)

Creates a render destination based on a Core Video pixel buffer.

init(ioSurface: IOSurface)

Creates a render destination based on an IOSurface object.

init(glTexture: UInt32, target: UInt32, width: Int, height: Int)

Creates a render destination based on an OpenGL texture.