---
title: maxInstanceCount
framework: metal
role: symbol
role_heading: Instance Property
path: metal/mtl4indirectinstanceaccelerationstructuredescriptor/maxinstancecount
---

# maxInstanceCount

Controls the maximum number of instance descriptors the instance descriptor buffer can reference.

## Declaration

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

## Discussion

Discussion You are responsible for ensuring that the final number of instances at build time, which you provide indirectly via a buffer reference in instanceCountBuffer, is less than or equal to this number.
