Contents

MTLResource

An allocation of memory accessible to a GPU.

Declaration

protocol MTLResource : MTLAllocation

Mentioned in

Overview

When you execute commands on the GPU, those commands can only affect memory allocated as MTLResource objects. Only the MTLDevice that created these resources can modify them. Different resource types have different uses. The most common resource types are buffers (MTLBuffer), which are linear allocations of memory, and textures (MTLTexture), which hold structured image data.

Topics

Identifying the resource

Reading memory and storage properties

Setting the purgeable state of the resource

Managing heap resources

Querying the allocated size

See Also

Common resource functionality