---
title: "makeMeshInstanceArray(renderTargets:count:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/lowlevelrendercontext/makemeshinstancearray(rendertargets:count:)"
---

# makeMeshInstanceArray(renderTargets:count:)

Creates a fixed-capacity ordered collection of mesh instances for the given render targets.

## Declaration

```swift
func makeMeshInstanceArray(renderTargets: LowLevelRenderTarget.DescriptorSet, count: Int) throws -> LowLevelMeshInstanceArray
```

## Parameters

- `renderTargets`: The set of render target descriptors this array must be compatible with.
- `count`: The maximum number of mesh instance slots to allocate.

## Return Value

Return Value A newly created LowLevelMeshInstanceArray.

## Discussion

Discussion Pass the resulting array to setMeshInstances(_:at:) to submit it for rendering. note: An error if allocation fails.

## See Also

### Creating meshes

- [makeMeshResource(descriptor:)](realitykit/lowlevelrendercontext/makemeshresource(descriptor:).md)
- [makeMeshPart(resource:indexOffset:indexCount:primitive:windingOrder:bounds:)](realitykit/lowlevelrendercontext/makemeshpart(resource:indexoffset:indexcount:primitive:windingorder:bounds:).md)
- [makeMeshInstance(meshPart:pipeline:geometryArguments:surfaceArguments:lightingArguments:transform:sortCategory:)](realitykit/lowlevelrendercontext/makemeshinstance(meshpart:pipeline:geometryarguments:surfacearguments:lightingarguments:transform:sortcategory:).md)
- [makeInstanceTransformResource(instanceCapacity:)](realitykit/lowlevelrendercontext/makeinstancetransformresource(instancecapacity:).md)
