useResource(_:usage:)
Makes a resource available to the acceleration structure pass.
Declaration
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(_:), overwrites any previously specified usage options for future dispatch calls within the same compute command encoder.