Instance Method

useHeap:

Specifies that a heap containing resources in an argument buffer can be safely used by a compute pass.

Required.

Declaration

- (void)useHeap:(id<MTLHeap>)heap;

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.

Resources within the specified heap can only be read or sampled from. This method ignores render targets (textures that specify a MTLTextureUsageRenderTarget usage option) and writable textures (textures that specify a MTLTextureUsageShaderWrite usage option) within the heap. To use these resources, you must call the useResource:usage: method instead.

See Also

Specifying Resource Usage for Argument Buffers

- useResource:usage:

Specifies that a resource in an argument buffer can be safely used by a compute pass.

Required.

- useResources:count:usage:

Specifies that an array of resources in an argument buffer can be safely used by a compute pass.

Required.

- useHeaps:count:

Specifies that an array of heaps containing resources in an argument buffer can be safely used by a compute pass.

Required.

MTLResourceUsage

The options that describe how a resource within an argument buffer will be used in a graphics or compute function.