---
title: instanceCapacity
framework: realitykit
role: symbol
role_heading: Instance Property
path: realitykit/lowlevelmeshresource/descriptor-swift.struct/instancecapacity
---

# instanceCapacity

The maximum number of instances the mesh supports when using per-instance vertex data.

## Declaration

```swift
var instanceCapacity: Int { get set }
```

## Discussion

Discussion Set this to the maximum number of instances you intend to draw when any Layout in vertexLayouts uses a stepFunction of .perInstance. Defaults to 0. Corresponds to MTLVertexDescriptor’s per-instance buffer layout capacity.
