---
title: "addUserResource(_:)"
framework: Compute Graph
role: symbol
role_heading: Instance Method
platforms: [iOS 27.0+, iPadOS 27.0+, Mac Catalyst 27.0+, macOS 27.0+, tvOS 27.0+, visionOS 27.0+]
path: "computegraph/computegraphsimulation/adduserresource(_:)"
---

# addUserResource(_:)

Registers a resource for residency on all command encoders used by this simulation.

## Declaration

```swift
final func addUserResource(_ resource: any MTLResource)
```

## Discussion

Discussion Only needed when buffers or textures are passed indirectly through structures using Metal Tier 2 Argument Buffers, since Metal cannot discover those resources automatically.
