---
title: sliceIndex
framework: compositorservices
role: symbol
role_heading: Instance Property
path: compositorservices/layerrenderer/drawable/view/texturemap-swift.struct/sliceindex
---

# sliceIndex

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

## Declaration

```swift
var sliceIndex: Int { get }
```

## Discussion

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

- [textureMap](compositorservices/layerrenderer/drawable/view/texturemap-swift.property.md)
- [textureIndex](compositorservices/layerrenderer/drawable/view/texturemap-swift.struct/textureindex.md)
- [viewport](compositorservices/layerrenderer/drawable/view/texturemap-swift.struct/viewport.md)
