Instance Property

renderTargetArrayLength

The number of active layers that all attachments must have for layered rendering.

Declaration

var renderTargetArrayLength: Int { get set }

Discussion

The default value is 0, indicating layered rendering is not enabled.

The table below gives typical values you might set, depending on the type of texture being used as attachments in the render pass. Your vertex shader must select the render target array index between 0 and renderTargetArrayLength-1.

Texture Type

Typical Length

MTLTextureType.type1DArray or MTLTextureType.type2DArray

The length of the texture array (arrayLength)

MTLTextureType.typeCube

6

MTLTextureType.typeCubeArray

6 times the length of the texture array (arrayLength)

See Also

Layered Rendering

Rendering to Multiple Texture Slices in a Draw Command

Select a destination texture slice in your vertex shader.

var renderTargetWidth: Int

The width, in pixels, to constrain the render target to.

var renderTargetHeight: Int

The height, in pixels, to constrain the render target to.