> ## 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.

# BuildRaytracingAccelerationStructure (XBOX Series 主机)

> 在 GPU 上执行光线跟踪加速结构构建，并可选地在构建后立即输出构建后信息。

在 GPU 上执行光线跟踪加速结构构建，并可选地在构建后立即输出构建后信息。

## 语法

```cpp theme={null}
void BuildRaytracingAccelerationStructure(
    const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC  pDesc,
    UINT NumPostbuildInfoDescs,
    const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC  pPostbuildInfoDescs
)
```

### 参数

*pDesc \[in]*\
类型：const D3D12\_BUILD\_RAYTRACING\_ACCELERATION\_STRUCTURE\_DESC \*

要构建的加速结构的描述。

*NumPostbuildInfoDescs \[in]*\
类型：UINT

<i>pPostbuildInfoDescs</i> 数组的大小。如果不需要构建后信息，则设置为 0。

*pPostbuildInfoDescs \[in]*\
类型：const D3D12\_RAYTRACING\_ACCELERATION\_STRUCTURE\_POSTBUILD\_INFO\_DESC \*

用于生成描述所构建加速结构属性的构建后信息的可选描述数组。

### 返回值

类型：void

无。

## 备注

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

也可以通过调用 [EmitRaytracingAccelerationStructurePostbuildInfo](/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist4/methods/id3d12graphicscommandlist4_emitraytracingaccelerationstructurepostbuildinfo_public) 从已构建的加速结构单独获取构建后信息。在构建时一并生成构建后信息的优势在于，构建完成到请求构建后信息之间不需要屏障，从而支持应用程序需要立即使用构建后信息的场景。

## 要求

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

## 另请参阅

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


## Related topics

- [CopyRaytracingAccelerationStructure (XBOX Series 主机)](/zh-CN/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist4/methods/id3d12graphicscommandlist4_copyraytracingaccelerationstructure_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)
