---
title: "useResidencySet(_:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlcommandbuffer/useresidencyset(_:)"
---

# useResidencySet(_:)

Applies a residency set to a command buffer.

## Declaration

```swift
func useResidencySet(_ residencySet: any MTLResidencySet)
```

## Parameters

- `residencySet`: A residency set that contains resource allocations, such as doc://com.apple.metal/documentation/Metal/MTLBuffer, doc://com.apple.metal/documentation/Metal/MTLTexture, and doc://com.apple.metal/documentation/Metal/MTLHeap instances.

## Mentioned in

Simplifying GPU resource management with residency sets

## Discussion

Discussion Each command buffer can maintain a list of up to 32 different residency sets. See Simplifying GPU resource management with residency sets and MTLResidencySet for more information.

## See Also

### Attaching residency sets

- [useResidencySets(_:)](metal/mtlcommandbuffer/useresidencysets(_:).md)
