<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLAccelerationStructureCommandEncoder/useResource(_:usage:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLAccelerationStructureCommandEncoder(im)useResource:usage:"
  },
  "title" : "useResource(_:usage:)"
}
-->

# useResource(_:usage:)

Makes a resource available to the acceleration structure pass.

```
func useResource(_ resource: any MTLResource, usage: MTLResourceUsage)
```

## Parameters

`resource`

A specific resource within an argument buffer.

`usage`

The options that describe how the compute function uses the resource.

## Discussion

This method makes the resource resident for the duration of a compute pass and ensures that it’s 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(_:)`](/documentation/Metal/MTLComputeCommandEncoder/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 ``doc://com.apple.metal/documentation/Metal/MTLFence`` instances.

---

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)