<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLDevice/makeResidencySet(descriptor:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLDevice(im)newResidencySetWithDescriptor:error:"
  },
  "title" : "makeResidencySet(descriptor:)"
}
-->

# makeResidencySet(descriptor:)

Creates a residency set, which can move resources in and out of memory residency.

```
func makeResidencySet(descriptor desc: MTLResidencySetDescriptor) throws -> any MTLResidencySet
```

## Parameters

`desc`

A descriptor instance that configures the residency set the method creates.

## Return Value

A new [`MTLResidencySet`](/documentation/Metal/MTLResidencySet) instance if the method completes successfully;
otherwise Swift throws an error and Objective-C returns `nil`.

## Discussion

Create an [`MTLResidencySet`](/documentation/Metal/MTLResidencySet) by creating and configuring an [`MTLResidencySetDescriptor`](/documentation/Metal/MTLResidencySetDescriptor) instance and pass it to this method.

See [Simplifying GPU resource management with residency sets](/documentation/Metal/simplifying-gpu-resource-management-with-residency-sets) 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)