Contents

sliceIndex

The index of the view’s texture in an array-based texture type.

Declaration

var sliceIndex: Int { get }

Discussion

Use the returned index to retrieve the view’s texture when the texture type is MTLTextureType.type2DArray. When configuring your render pass descriptor, specify the index in the slice property of the descriptor’s color and depth attachments.

If you don’t use array-based textures for drawing, fetch the index using textureIndex instead.

See Also

Getting the view’s texture map