> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CopyRaytracingAccelerationStructure (XBOX Series 主机)

> 将源加速结构复制到目标内存，同时应用指定的变换。

将源加速结构复制到目标内存，同时应用指定的变换。

## 语法

```cpp theme={null}
void CopyRaytracingAccelerationStructure(
    D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData,
    D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData,
    D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE Mode
)
```

### 参数

*DestAccelerationStructureData \[in]*\
类型：D3D12\_GPU\_VIRTUAL\_ADDRESS

目标内存。如果指定的 <i>Mode</i> 需要，可以通过事先调用 [EmitRaytracingAccelerationStructurePostbuildInfo](/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist4/methods/id3d12graphicscommandlist4_emitraytracingaccelerationstructurepostbuildinfo_public) 来获知所需大小。

无论指定的 <i>Mode</i> 如何，目标起始地址必须按 256 字节对齐，即 [D3D12\_RAYTRACING\_ACCELERATION\_STRUCTURE\_BYTE\_ALIGNMENT](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/constants) 中定义的值。

目标内存范围不能与源重叠。否则，结果未定义。

所指向内存必须处于的资源状态取决于 <i>Mode</i> 参数。有关更多信息，请参阅 [D3D12\_RAYTRACING\_ACCELERATION\_STRUCTURE\_COPY\_MODE](/reference/graphics/d3d12/enums/d3d12_raytracing_acceleration_structure_copy_mode_public)。

*SourceAccelerationStructureData \[in]*\
类型：D3D12\_GPU\_VIRTUAL\_ADDRESS

要根据指定的 <i>Mode</i> 复制/变换的加速结构或其他类型数据的地址。数据保持不变且可用。该操作仅复制 <i>SourceAccelerationStructureData</i> 所指向的数据，而不复制任何其他数据（例如加速结构），即使源数据可能指向这些数据。例如，对于顶层加速结构，其指向的任何底层加速结构在操作中都不会被复制。

无论指定的 <i>Mode</i> 如何，源内存必须按 256 字节对齐，即 [D3D12\_RAYTRACING\_ACCELERATION\_STRUCTURE\_BYTE\_ALIGNMENT](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/constants) 中定义的值。

所指向内存必须处于的资源状态取决于 <i>Mode</i> 参数。有关更多信息，请参阅 [D3D12\_RAYTRACING\_ACCELERATION\_STRUCTURE\_COPY\_MODE](/reference/graphics/d3d12/enums/d3d12_raytracing_acceleration_structure_copy_mode_public)。

*Mode \[in]*\
类型：D3D12\_RAYTRACING\_ACCELERATION\_STRUCTURE\_COPY\_MODE

要执行的复制操作的类型。有关更多信息，请参阅 [D3D12\_RAYTRACING\_ACCELERATION\_STRUCTURE\_COPY\_MODE](/reference/graphics/d3d12/enums/d3d12_raytracing_acceleration_structure_copy_mode_public)。

### 返回值

类型：void

无。

## 备注

由于光线跟踪加速结构可能包含内部指针并具有设备相关的不透明布局，因此复制它们或以其他方式操纵它们需要专用 API，以便驱动程序可以处理请求的操作。

此方法可以从图形或计算命令列表调用，但不能从捆绑包调用。

## 要求

**头文件：** d3d12\_xs.h\
**库：** d3d12\_xs.lib\
**支持的平台**：XBOX Series 主机

## 另请参阅

[ID3D12GraphicsCommandList4](/reference/graphics/d3d12_xs/interfaces/ID3D12GraphicsCommandList4/id3d12graphicscommandlist4)


## Related topics

- [BuildRaytracingAccelerationStructure (XBOX Series 主机)](/zh-CN/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist4/methods/id3d12graphicscommandlist4_buildraytracingaccelerationstructure_public.md)
- [D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_TOOLS_VISUALIZATION_HEADER (XBOX Series consoles)](/zh-CN/reference/graphics/d3d12/structs/d3d12_build_raytracing_acceleration_structure_tools_visualization_header_public.md)
- [D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_SERIALIZATION_DESC (XBOX Series consoles)](/zh-CN/reference/graphics/d3d12/structs/d3d12_raytracing_acceleration_structure_postbuild_info_serialization_desc_public.md)
- [D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_COMPACTED_SIZE_DESC (XBOX Series consoles)](/zh-CN/reference/graphics/d3d12/structs/d3d12_raytracing_acceleration_structure_postbuild_info_compacted_size_desc_public.md)
- [D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_CURRENT_SIZE_DESC (XBOX Series consoles)](/zh-CN/reference/graphics/d3d12/structs/d3d12_raytracing_acceleration_structure_postbuild_info_current_size_desc_public.md)
