Contents

storageModeShared

The CPU and GPU share access to the resource, allocated in system memory.

Declaration

static var storageModeShared: MTLResourceOptions { get }

Discussion

This is the default storage mode for MTLBuffer instances on integrated GPUs and both MTLBuffer and MTLTexture instances on Apple silicon GPUs. On non-Apple family GPUs, the shared storage mode isn’t available for MTLTexture instances.

When either the CPU or GPU changes the contents of the resource, you’re responsible for synchronizing access to the texture from the other participant. Ensure that all changes you schedule on either the CPU or GPU for a resource that uses shared memory complete before accessing that resource on the other processor.

For more guidance on how to choose storage modes, see Setting resource storage modes.

See Also

Specifying storage modes