Structure

MTLResourceUsage

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

Declaration

struct MTLResourceUsage

Overview

Multiple MTLResourceUsage values may be combined with a bitwise OR (|) if the resource will serve multiple uses over its lifetime. Enabling certain options for certain resources determines whether the Metal driver should convert the resource to another format (for example, whether to decompress a color render target).

Topics

Type Properties

static var read: MTLResourceUsage

An option that enables reading from the resource.

static var write: MTLResourceUsage

An option that enables writing to the resource.

static var sample: MTLResourceUsage

An option that enables sampling from the resource.

Relationships

Conforms To

See Also

Specifying Resource Usage for Argument Buffers

func useResource(MTLResource, usage: MTLResourceUsage)

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

Required.

func useResources([MTLResource], usage: MTLResourceUsage)

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

func useHeap(MTLHeap)

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

Required.

func useHeaps([MTLHeap])

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