Instance Method

useResource:usage:

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

Required.

Declaration

- (void)useResource:(id<MTLResource>)resource usage:(MTLResourceUsage)usage;

Parameters

resource

A specific resource within an argument buffer.

usage

The options that describe how the resource will be used by a compute function.

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.

See Also

Specifying Resource Usage for Argument Buffers

- useResources:count:usage:

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

Required.

- useHeap:

Specifies that a heap containing 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.