---
title: "updateMappings(buffer:heap:operations:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtl4commandqueue/updatemappings(buffer:heap:operations:)"
---

# updateMappings(buffer:heap:operations:)

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

## Declaration

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

## Parameters

- `buffer`: A placement sparse doc://com.apple.metal/documentation/Metal/MTLBuffer.
- `heap`: An doc://com.apple.metal/documentation/Metal/MTLHeap you allocate with type doc://com.apple.metal/documentation/Metal/MTLHeapType/placement.
- `operations`: An array of doc://com.apple.metal/documentation/Metal/MTL4UpdateSparseBufferMappingOperation instances to perform.

## Discussion

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 that has a maxCompatiblePlacementSparsePageSize of at least the buffer’s placementSparsePageSize you assign when creating the sparse buffer via makeBuffer(length:options:placementSparsePageSize:).
