Instance Method

useResource:usage:

Adds an untracked resource to the render pass.

Required.

Declaration

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

Parameters

resource

A resource within an argument buffer.

usage

Options for describing how a graphics function uses the resource.

Discussion

This method makes the resource 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 resource. 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.

- useResources:count:usage:

Adds an array of untracked resources 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.