Enumeration

MTLResourceOptions

Optional arguments used to set the behavior of a resource.

Declaration

typedef enum MTLResourceOptions : NSUInteger {
    ...
} MTLResourceOptions;

Topics

Specifying CPU Cache Modes

MTLResourceCPUCacheModeDefaultCache

The default CPU cache mode for the resource, which guarantees that read and write operations are executed in the expected order.

MTLResourceCPUCacheModeWriteCombined

A write-combined CPU cache mode that is optimized for resources that the CPU writes into, but never reads.

Specifying Storage Modes

MTLResourceStorageModeShared

The resource is stored in system memory and is accessible to both the CPU and the GPU.

MTLResourceStorageModeManaged

The CPU and GPU may maintain separate copies of the resource, and any changes must be explicitly synchronized.

MTLResourceStorageModePrivate

The resource can be accessed only by the GPU.

MTLResourceStorageModeMemoryless

The resource’s contents can be accessed only by the GPU and only exist temporarily during a render pass.

Specifying Hazard Tracking

MTLResourceHazardTrackingModeDefault

An option specifying that the default tracking mode should be used.

MTLResourceHazardTrackingModeTracked

An option specifying that Metal prevents hazards when modifying this object's contents.

Beta
MTLResourceHazardTrackingModeUntracked

An option specifying that the app must prevent hazards when modifying this object's contents.

Deprecated Options

MTLResourceOptionCPUCacheModeDefault

This constant was deprecated in iOS 9.0 and macOS 10.11.

MTLResourceOptionCPUCacheModeWriteCombined

This constant was deprecated in iOS 9.0 and macOS 10.11.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software