Instance Method

useResources:count:usage:

Adds an array of untracked resources to the render pass.

Required.

Declaration

- (void)useResources:(id<MTLResource>  _Nonnull const *)resources count:(NSUInteger)count usage:(MTLResourceUsage)usage;

Parameters

resources

An array of resources within an argument buffer.

count

The number of resources in the array.

usage

Options for describing how a graphics function uses the resources.

Discussion

This method makes the array of resources resident for the duration of the render pass and ensures that it's in a format compatible with the graphics function.

Call this method before issuing any draw calls that may access the array of resources. Calling this method again, or calling useHeap:, overwrites any previously specified usage options for future draw calls within the same render command encoder.

When working with color render targets, call this method as late as possible to improve performance.

See Also

Specifying Resource Usage for Argument Buffers

- useResource:usage:stages:

Adds an untracked resource to the render pass, specifying which render stages need it.

Required.

- useResources:count:usage:stages:

Adds an array of untracked resources to the render pass, specifying which stages need them.

Required.

- useHeap:stages:

Adds the resources in a heap to the render pass, specifying which render stages need them.

Required.

- useHeaps:count:stages:

Adds the resources in an array of heaps to the render pass, specifying which render stages need them.

Required.

- useResource:usage:

Adds an untracked resource to the render pass.

Required.

- useHeap:

Adds the resources in a heap to the render pass.

Required.

- useHeaps:count:

Adds the resources in an array of heaps to the render pass.

Required.

MTLResourceUsage

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