<!--
{
  "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/copyMappings(sourceBuffer:destinationBuffer:operations:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "s:So16MTL4CommandQueueP5MetalE12copyMappings12sourceBuffer011destinationH010operationsySo9MTLBuffer_p_SoAH_pSaySo0a10CopySparseH16MappingOperationaGtF"
  },
  "title" : "copyMappings(sourceBuffer:destinationBuffer:operations:)"
}
-->

# copyMappings(sourceBuffer:destinationBuffer:operations:)

Copies multiple offsets within a source placement sparse buffer to a destination placement sparse buffer.

```
func copyMappings(sourceBuffer: any MTLBuffer, destinationBuffer: any MTLBuffer, operations: [MTL4CopySparseBufferMappingOperation])
```

## Parameters

`sourceBuffer`

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

`destinationBuffer`

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

`operations`

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

## Discussion

You are responsible for ensuring the source destination sparse buffers have the same `placementSparsePageSize` when
you create them via [`makeBuffer(length:options:placementSparsePageSize:)`](/documentation/Metal/MTLDevice/makeBuffer(length:options:placementSparsePageSize:)).

Additionally, you are responsible for ensuring both the source and destination sparse buffers don’t use the same aliased
tiles at the same time.

> Note: If a sparse texture and a sparse buffer share the same backing tiles, these don’t provide you
> with meaningful views of the other resource’s data.

---

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)