<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTL4CommandQueue/updateMappings(buffer:heap:operations:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "s:So16MTL4CommandQueueP5MetalE14updateMappings6buffer4heap10operationsySo9MTLBuffer_p_So7MTLHeap_pSgSaySo0A34UpdateSparseBufferMappingOperationaGtF"
  },
  "title" : "updateMappings(buffer:heap:operations:)"
}
-->

# updateMappings(buffer:heap:operations:)

Updates multiple regions within a placement sparse buffer to alias specific tiles from a Metal heap.

```
func updateMappings(buffer: any MTLBuffer, heap: (any MTLHeap)?, operations: [MTL4UpdateSparseBufferMappingOperation])
```

## Parameters

`buffer`

A placement sparse [`MTLBuffer`](/documentation/Metal/MTLBuffer).

`heap`

An [`MTLHeap`](/documentation/Metal/MTLHeap) you allocate with type [`MTLHeapType.placement`](/documentation/Metal/MTLHeapType/placement).

`operations`

An array of [`MTL4UpdateSparseBufferMappingOperation`](/documentation/Metal/MTL4UpdateSparseBufferMappingOperation) instances to perform.

## Discussion

You can provide a `nil` parameter to the `heap` argument only when you perform unmap operations. Otherwise, you are
responsible for ensuring parameter `heap` references an [`MTLHeap`](/documentation/Metal/MTLHeap) that has a [`maxCompatiblePlacementSparsePageSize`](/documentation/Metal/MTLHeapDescriptor/maxCompatiblePlacementSparsePageSize)
of at least the buffer’s `placementSparsePageSize` you assign when creating the sparse buffer via
[`makeBuffer(length:options:placementSparsePageSize:)`](/documentation/Metal/MTLDevice/makeBuffer(length:options:placementSparsePageSize:)).

---

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)