<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTL4CommandQueue/addResidencySets(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "s:So16MTL4CommandQueueP5MetalE16addResidencySetsyySaySo15MTLResidencySet_pGF"
  },
  "title" : "addResidencySets(_:)"
}
-->

# addResidencySets(_:)

Applies multiple residency sets to a queue, which Metal applies to the queue’s command buffers as you commit them.

```
func addResidencySets(_ residencySets: [any MTLResidencySet])
```

## Parameters

`residencySets`

An array of residency sets, each of which contains resource allocations, such as [`MTLBuffer`](/documentation/Metal/MTLBuffer), [`MTLTexture`](/documentation/Metal/MTLTexture), and [`MTLHeap`](/documentation/Metal/MTLHeap) instances.

## Discussion

Each command queue can maintain a list of up to 32 different residency sets.
See [Simplifying GPU resource management with residency sets](/documentation/Metal/simplifying-gpu-resource-management-with-residency-sets) and [`MTLResidencySet`](/documentation/Metal/MTLResidencySet) for more information.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)