copy(sourceAccelerationStructure:destinationAccelerationStructure:)
Encodes an acceleration structure copy operation into the command buffer.
Declaration
func copy(sourceAccelerationStructure: any MTLAccelerationStructure, destinationAccelerationStructure: any MTLAccelerationStructure)Parameters
- sourceAccelerationStructure:
Acceleration structure to copy from.
- destinationAccelerationStructure:
Acceleration structure to copy to.
Discussion
You are responsible for ensuring the source and destination acceleration structures don’t overlap in memory. If this is an instance acceleration structure, Metal preserves references to the primitive acceleration structures it references.
Typically, the destination acceleration structure is at least as large as the source acceleration structure, except in cases where you compact the source acceleration structure. In this case, you need to allocate the destination acceleration to be at least as large as the compacted size of the source acceleration structure.