<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLAccelerationStructureCommandEncoder/copy(sourceAccelerationStructure:destinationAccelerationStructure:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLAccelerationStructureCommandEncoder(im)copyAccelerationStructure:toAccelerationStructure:"
  },
  "title" : "copy(sourceAccelerationStructure:destinationAccelerationStructure:)"
}
-->

# copy(sourceAccelerationStructure:destinationAccelerationStructure:)

Encodes a command to copy the data from one acceleration structure to another.

```
func copy(sourceAccelerationStructure: any MTLAccelerationStructure, destinationAccelerationStructure: any MTLAccelerationStructure)
```

## Parameters

`sourceAccelerationStructure`

The source acceleration structure.

`destinationAccelerationStructure`

The destination acceleration structure.

## Discussion

The destination acceleration structure needs to be at least as large as the source
acceleration structure, unless you’re compacting the source acceleration structure.
In that case, the destination acceleration structure needs be at least as large
as the compact size of the source acceleration structure.

If the source acceleration structure contains references to other acceleration structures,
the copy of the acceleration structure also refers to the same child structures.

---

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)