<!--
{
  "documentType" : "article",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/choosing-a-resource-storage-mode-for-apple-gpus",
  "metadataVersion" : "0.1.0",
  "role" : "article",
  "title" : "Choosing a resource storage mode for Apple GPUs"
}
-->

# Choosing a resource storage mode for Apple GPUs

Select an appropriate storage mode for your textures and buffers on Apple GPUs.

## Discussion

Apple GPUs have a unified memory model in which the CPU and the GPU share system memory. However, CPU and GPU access to that memory depends on the storage mode you choose for your resources. The [`MTLStorageMode.shared`](/documentation/Metal/MTLStorageMode/shared) mode defines system memory that both the CPU and the GPU can access. The [`MTLStorageMode.private`](/documentation/Metal/MTLStorageMode/private) mode defines system memory that only the GPU can access.

The [`MTLStorageMode.memoryless`](/documentation/Metal/MTLStorageMode/memoryless) mode defines tile memory within the GPU that only the GPU can access. Tile memory has higher bandwidth, lower latency, and consumes less power than system memory.

![A diagram that shows the three types of Apple GPU resource storage modes: shared at the top, private in the middle, and memoryless at the bottom. The shared mode resource is in between a GPU and CPU with bidirectional arrows pointing to and from each. The private mode resource is next to a GPU with a bidirectional arrow between them. The memoryless mode resource appears inside a GPU’s tiled memory region.](images/com.apple.metal/choosing-a-resource-storage-mode-for-apple-gpus-1@2x.png)

### Choose a resource storage mode for buffers or textures

The storage mode you choose depends on how you plan to use Metal resources:

- Populate and update on the CPU: Data shared by the CPU and GPU. Use [`MTLStorageMode.shared`](/documentation/Metal/MTLStorageMode/shared). The CPU and GPU share data. This is the default for buffer and texture storage.
- Access exclusively on the GPU: Data owned by the GPU. Use [`MTLStorageMode.private`](/documentation/Metal/MTLStorageMode/private). Choose the mode if you populate your resource with the GPU through a compute, render, or blit pass. This case is common for render targets, intermediary resources, or texture streaming. For guidance on how to copy data to a private resource, see [Copying data to a private resource](/documentation/Metal/copying-data-to-a-private-resource).
- Populate on CPU and access frequently on GPU: Shared integrated memory for the CPU and GPU. Use [`MTLStorageMode.shared`](/documentation/Metal/MTLStorageMode/shared).
- Temporary texture contents for GPU passes: Memory held by the GPU for textures within or between passes. Use [`MTLStorageMode.memoryless`](/documentation/Metal/MTLStorageMode/memoryless). Memoryless mode only works for textures, and stores temporary resources in tiled memory for high performance. An example is a depth or stencil texture thatʼs used only within a single pass and isnʼt needed in an earlier or later rendering stage.

For information on setting storage modes in your app, see [Setting resource storage modes](/documentation/Metal/setting-resource-storage-modes).

### Create a memoryless render target

To create a memoryless render target, set the [`storageMode`](/documentation/Metal/MTLTextureDescriptor/storageMode) property of an [`MTLTextureDescriptor`](/documentation/Metal/MTLTextureDescriptor) to [`MTLStorageMode.memoryless`](/documentation/Metal/MTLStorageMode/memoryless) and use this descriptor to create a new [`MTLTexture`](/documentation/Metal/MTLTexture). Then set this new texture as the [`texture`](/documentation/Metal/MTLRenderPassAttachmentDescriptor/texture) property of an [`MTLRenderPassAttachmentDescriptor`](/documentation/Metal/MTLRenderPassAttachmentDescriptor).

```swift
let memorylessDescriptor = MTLTextureDescriptor.texture2DDescriptor(pixelFormat: .r16Float,
                                                                    width: 256,
                                                                    height: 256,
                                                                    mipmapped: true)
memorylessDescriptor.storageMode = .memoryless
let memorylessTexture = device.makeTexture(descriptor: memorylessDescriptor)

let renderPassDescriptor = MTLRenderPassDescriptor()
renderPassDescriptor.depthAttachment.texture = memorylessTexture
```

See [Rendering a scene with deferred lighting in Objective-C](/documentation/Metal/rendering-a-scene-with-deferred-lighting-in-objective-c) for an example of an app that uses a memoryless render target.

> Note:
> You can create only textures, not buffers, using ``doc://com.apple.metal/documentation/Metal/MTLStorageMode/memoryless`` mode. You can’t use buffers as memoryless render targets.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)