<!--
{
  "documentType" : "article",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/resource-fundamentals",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Resource fundamentals"
}
-->

# Resource fundamentals

Control the common attributes of all Metal memory resources, including buffers and textures,
and how to configure their underlying memory.

## Discussion

A *resource* is a memory asset, such as an [`MTLBuffer`](/documentation/Metal/MTLBuffer) or [`MTLTexture`](/documentation/Metal/MTLTexture),
that a GPU can access (see [Buffers](/documentation/Metal/buffers) and [Textures](/documentation/Metal/textures)).

You can either allocate a resource from an [`MTLDevice`](/documentation/Metal/MTLDevice) instance
or an [`MTLHeap`](/documentation/Metal/MTLHeap) instance (see [Memory heaps](/documentation/Metal/memory-heaps)).
Metal sets a resource’s [`hazardTrackingMode`](/documentation/Metal/MTLResource/hazardTrackingMode) property to
[`MTLHazardTrackingMode.default`](/documentation/Metal/MTLHazardTrackingMode/default) if you don’t select another tracking mode.
The default value depends on what Metal instance creates the resource.

> Important: The value of an ``doc://com.apple.metal/documentation/Metal/MTLResource`` instance’s
> ``doc://com.apple.metal/documentation/Metal/MTLResource/hazardTrackingMode`` property has no effect on the work you
> submit to an ``doc://com.apple.metal/documentation/Metal/MTL4CommandQueue`` (see <doc://com.apple.metal/documentation/Metal/resource-synchronization>) or resources
> that commands access through an argument buffer.

Each resource your app creates typically uses one of these storage modes:

- [`MTLStorageMode.private`](/documentation/Metal/MTLStorageMode/private): Apps can only access resources in private storage from the GPU.
- [`MTLStorageMode.shared`](/documentation/Metal/MTLStorageMode/shared): Apps can access resources in shared storage from both the CPU and the GPU.
- [`MTLStorageMode.managed`](/documentation/Metal/MTLStorageMode/managed): Apps can access resources in managed storage from both the CPU and the GPU, just like shared storage. However, the GPU backs resources in managed mode with memory in private storage.

Private mode resources give your app optimization opportunities that shared mode resources don’t.
Managed mode resources also give your app the same opportunities and allow your to app access them from the CPU.

## Topics

### Resource management

[Setting resource storage modes](/documentation/Metal/setting-resource-storage-modes)

Set a storage mode that defines the memory location and access permissions of a resource.

[Choosing a resource storage mode for Apple GPUs](/documentation/Metal/choosing-a-resource-storage-mode-for-apple-gpus)

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

[Choosing a resource storage mode for Intel and AMD GPUs](/documentation/Metal/choosing-a-resource-storage-mode-for-intel-and-amd-gpus)

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

[Copying data to a private resource](/documentation/Metal/copying-data-to-a-private-resource)

Use a blit command encoder to copy buffer or texture data to a private resource.

[Synchronizing a managed resource in macOS](/documentation/Metal/synchronizing-a-managed-resource-in-macos)

Manually synchronize memory for a Metal resource in apps.

[Transferring data between connected GPUs](/documentation/Metal/transferring-data-between-connected-gpus)

Use high-speed connections between GPUs to transfer data quickly.

[Reducing the memory footprint of Metal apps](/documentation/Metal/reducing-the-memory-footprint-of-metal-apps)

Learn best practices for using memory efficiently in iOS and tvOS.

### Residency sets

[Simplifying GPU resource management with residency sets](/documentation/Metal/simplifying-gpu-resource-management-with-residency-sets)

Organize your resources into groups and influence when they become accessible to the GPU.

[`MTLResidencySet`](/documentation/Metal/MTLResidencySet)

A collection of resource allocations that can move in and out of resident memory.

[`MTLResidencySetDescriptor`](/documentation/Metal/MTLResidencySetDescriptor)

A configuration that customizes the behavior for a residency set.

### View pools

[`MTLResourceViewPool`](/documentation/Metal/MTLResourceViewPool)

Contains views over resources of a specific type, and allows you to manage those views.

[`MTLResourceViewPoolDescriptor`](/documentation/Metal/MTLResourceViewPoolDescriptor)

Provides parameters for creating a resource view pool.

[`MTLTextureViewPool`](/documentation/Metal/MTLTextureViewPool)

A pool of lightweight texture views.

[`MTLTextureViewDescriptor`](/documentation/Metal/MTLTextureViewDescriptor)

### Tensors

[`MTLTensor`](/documentation/Metal/MTLTensor)

A resource representing a multi-dimensional array that you can use with machine learning workloads.

[`MTLTensorDescriptor`](/documentation/Metal/MTLTensorDescriptor)

A configuration type for creating new tensor instances.

[`MTLTensorExtents`](/documentation/Metal/MTLTensorExtents)

An integer array that holds per-dimension values such as tensor sizes, strides, or block factors

[`MTLTensorReferenceType`](/documentation/Metal/MTLTensorReferenceType)

An object that represents a tensor in the shading language in a struct or array.

[`MTLTensorUsage`](/documentation/Metal/MTLTensorUsage)

The contexts in which you can use a tensor.

[`MTLTensorDomain`](/documentation/Metal/MTLTensorDomain)

An error domain for errors that pertain to creating a tensor.

[`MTLTensorBinding`](/documentation/Metal/MTLTensorBinding)

An object that represents a tensor bound to a graphics or compute function or a machine learning function.

[`MTLTensorError`](/documentation/Metal/MTLTensorError-swift.struct)

[`MTLTensorError.Code`](/documentation/Metal/MTLTensorError-swift.struct/Code)

The error codes that Metal can raise when you create a tensor.

[`MTLTensorDataType`](/documentation/Metal/MTLTensorDataType)

The possible data types for the elements of a tensor.

[`MTLTensorDomain`](/documentation/Metal/MTLTensorDomain)

An error domain for errors that pertain to creating a tensor.

[`MTL_TENSOR_MAX_RANK`](/documentation/Metal/MTL_TENSOR_MAX_RANK)

### Sparse resources

[`MTLBufferSparseTier`](/documentation/Metal/MTLBufferSparseTier)

Enumerates the different support levels for sparse buffers.

[`MTL4CopySparseBufferMappingOperation`](/documentation/Metal/MTL4CopySparseBufferMappingOperation)

Groups together arguments for an operation to copy a sparse buffer mapping.

[`MTL4UpdateSparseBufferMappingOperation`](/documentation/Metal/MTL4UpdateSparseBufferMappingOperation)

Groups together arguments for an operation to update a sparse buffer mapping.

[`MTLTextureSparseTier`](/documentation/Metal/MTLTextureSparseTier)

Enumerates the different support levels for sparse textures.

[`MTL4CopySparseTextureMappingOperation`](/documentation/Metal/MTL4CopySparseTextureMappingOperation)

Groups together arguments for an operation to copy a sparse texture mapping.

[`MTL4UpdateSparseTextureMappingOperation`](/documentation/Metal/MTL4UpdateSparseTextureMappingOperation)

Groups together arguments for an operation to update a sparse texture mapping.

### Common resource functionality

[`MTLGPUAddress`](/documentation/Metal/MTLGPUAddress)

A 64-bit unsigned integer type appropriate for storing GPU addresses.

[`MTLAllocation`](/documentation/Metal/MTLAllocation)

A memory allocation from a Metal GPU device, such as a memory heap, texture, or data buffer.

[`MTLResource`](/documentation/Metal/MTLResource)

An allocation of memory accessible to a GPU.

[`MTLResourceOptions`](/documentation/Metal/MTLResourceOptions)

Optional arguments used to set the behavior of a resource.

[`MTLResourceUsage`](/documentation/Metal/MTLResourceUsage)

Options that describe how a graphics or compute function uses an argument buffer’s resource.

[`MTLResourceID`](/documentation/Metal/MTLResourceID)



---

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)