---
title: "useResources(_:usage:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlaccelerationstructurecommandencoder/useresources(_:usage:)"
---

# useResources(_:usage:)

Makes multiple resources available to the acceleration structure pass.

## Declaration

```swift
func useResources(_ resources: [any MTLResource], usage: MTLResourceUsage)
```

## Parameters

- `resources`: An array of resources within an argument buffer.
- `usage`: Options that indicate how a GPU function accesses each resource in resources.

## Discussion

Discussion This method makes the resources resident for the duration of a compute pass and ensures that they are in a format compatible with the compute function. Call this method before issuing any dispatch calls that may access the resource. Calling this method again, or calling useHeap(_:), overwrites any previously specified usage options for future dispatch calls within the same compute command encoder. note: You can track resource access and dependency hazards with MTLFence instances.

## See Also

### Making indirect resources resident

- [useHeap(_:)](metal/mtlaccelerationstructurecommandencoder/useheap(_:).md)
- [useHeaps(_:)](metal/mtlaccelerationstructurecommandencoder/useheaps(_:).md)
- [useResource(_:usage:)](metal/mtlaccelerationstructurecommandencoder/useresource(_:usage:).md)
- [MTLResourceUsage](metal/mtlresourceusage.md)
