Enumeration Case

MTLStorageMode.memoryless

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

Declaration

case memoryless = 3

Discussion

In macOS, the memoryless storage mode is not available.

Memoryless resources can be used only as temporary render targets in a render pass (in effect, MTLTexture objects configured and used with a MTLRenderPassAttachmentDescriptor object). You can’t load the texture’s contents at the start of the render pass (MTLLoadAction.load), nor may you store its contents (MTLStoreAction.store) at the end of the render pass.

Use memoryless resources whenever a render target’s contents are only needed during the rendering process. For example, most render passes do not store depth attachments and multisample attachments to memory. You can significantly reduce your memory usage by creating these attachments as memoryless resources.

On Metal devices that support tile rendering, you can use imageblocks to manage transient rendering data more flexibly. See Metal Shading Language specification.

For more guidance on how to choose storage modes, see Setting Resource Storage Modes.

See Also

Storage Mode Options

case shared

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

case managed

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

case `private`

The resource can be accessed only by the GPU.