Contents

useHeap(_:)

Makes the resources contained in the specified heap available to the acceleration structure pass.

Declaration

func useHeap(_ heap: any MTLHeap)

Parameters

  • heap:

    A heap that contains resources within an argument buffer.

Discussion

This method makes all the resources in the heap resident for the duration of a compute pass and ensures that they’re in a format compatible with the compute function.

Call this method before issuing any dispatch calls that may access the resources in the heap.

You can only read or sample resources in the specified heap. This method ignores render targets (textures that specify a renderTarget usage option) and writable textures (textures that specify a shaderWrite usage option) within the heap. To use these resources, you need to call the useResource(_:usage:) method instead.

See Also

Making indirect resources resident