Instance Method

use(_:count:stages:)

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

Required.

Declaration

func use(_ heaps: UnsafePointer<MTLHeap>, count: Int, stages: MTLRenderStages)

Parameters

heaps

An array of heaps that contains resources within an argument buffer.

count

The number of heaps in the array.

stages

The render stages where the resources must be resident.

Discussion

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

Call this method before issuing any draw calls that access the resources in the array of heaps.

You may only read or sample resources within the specified heaps. This method ignores render targets (textures that specify a renderTarget usage option) and writable textures (textures that specify a shaderWrite usage option) within the array of heaps. To use these resources, you must call the use(_:usage:stages:) method instead.

See Also

Specifying Resource Usage for Argument Buffers

func use(MTLResource, usage: MTLResourceUsage, stages: MTLRenderStages)

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

Required.

func use(UnsafePointer<MTLResource>, count: Int, usage: MTLResourceUsage, stages: MTLRenderStages)

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

Required.

func use(MTLHeap, stages: MTLRenderStages)

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

Required.

func useResource(MTLResource, usage: MTLResourceUsage)

Adds an untracked resource to the render pass.

Required.

func useHeap(MTLHeap)

Adds the resources in a heap to the render pass.

Required.

func useHeaps([MTLHeap])

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

func useResources([MTLResource], usage: MTLResourceUsage)

Adds an array of untracked resources to the render pass.

struct MTLResourceUsage

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