Instance Property

renderTargetArrayLength

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

Declaration

@property(nonatomic) NSUInteger renderTargetArrayLength;

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

MTLTextureType1DArray or MTLTextureType2DArray

The length of the texture array (arrayLength)

MTLTextureTypeCube

6

MTLTextureTypeCubeArray

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.

renderTargetWidth

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

renderTargetHeight

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