Instance Property

texture

The texture object associated with this attachment.

Declaration

var texture: MTLTexture? { get set }

Discussion

You must set the attachment’s texture property, choosing an appropriate pixel format for the texture.

  • To store color values in an attachment, use a texture with a color-renderable pixel format.

  • To store depth values, use a texture with a depth-renderable pixel format, such as MTLPixelFormat.depth32Float.

  • To store stencil values, use a texture with a stencil-renderable pixel format, such as MTLPixelFormat.stencil8.

See Also

Specifying the Texture for the Attachment

var level: Int

The mipmap level of the texture used for rendering to the attachment.

var slice: Int

The slice of the texture used for rendering to the attachment.

var depthPlane: Int

The depth plane of the texture used for rendering to the attachment.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software