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

# XGBVHComputer::DecompressBVH_BatchedGPU

> 使用 GPU 解壓縮一或多個 BVH

使用 GPU 解壓縮一或多個 BVH。

<div class="alert">**注意：此 API 已被取代，並將在 2024 年 6 月 GDK 中移除**</div>

請改用 `RehydrateRaytracingAccelerationStructureX`。

## 語法

```cpp theme={null}
HRESULT DecompressBVH_BatchedGPU(  
    _In_ ID3D12GraphicsCommandList* pCommandList,
    _In_reads_(NumDescs) const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC Descs[],
    _In_ UINT32                     NumDescs
)  
```

### 參數

*pCommandList*   \_In\_<br />類型：ID3D12GraphicsCommandList\*

要在其上發出計算工作的 D3D12 命令清單

*Descs*   \_In\_<br />類型：const D3D12\_BUILD\_RAYTRACING\_ACCELERATION\_STRUCTURE\_DESC\[]

要解壓縮的 BVH 描述陣列

*NumDescs*   \_In\_<br />類型：UINT32

要解壓縮的 BVH 數目

### 傳回值

類型：HRESULT

如果成功，則傳回 S\_OK；否則傳回錯誤碼。如需錯誤碼清單，請參閱 [Direct3D 12 傳回碼](https://learn.microsoft.com/en-us/windows/win32/direct3d12/d3d12-graphics-reference-returnvalues)。

## 備註

此 API 需要 D3D 裝置。請使用 [XGCreateBVHComputer2](/zh-TW/reference/graphics/xg_xs/functions/xgcreatebvhcomputer2_xs)。

可由 GPU 解壓縮的格式與可由 CPU 解壓縮的格式不同。為了確保與此 API 相容，請搭配 CopyRaytracingAccelerationStructure() 使用 D3D12XBOX\_RAYTRACING\_ACCELERATION\_STRUCTURE\_COPY\_MODE\_SERIALIZE\_AND\_COMPRESS\_FOR\_GPU，而不是 D3D12XBOX\_RAYTRACING\_ACCELERATION\_STRUCTURE\_COPY\_MODE\_SERIALIZE\_AND\_COMPRESS。

每個 BVH 都需要暫存記憶體才能解壓縮。應使用相關方法 GetRequiredGpuScratchSizeInBytes() 來查詢要為每個 BVH 配置多少 GPU 記憶體。使用 Desc.ScratchAccelerationStructureData 指派暫存指標。

此 API 在離線驅動程式中無法使用。

<a id="requirements" />

## 需求

**標頭：** xg\_xs.h

**程式庫：** xg\_xs.lib<br />**支援的平台**：XBOX Series 主機

## 另請參閱

[XGBVHComputer](/zh-TW/reference/graphics/xg_xs/interfaces/XGBVHComputer/xgbvhcomputer_xs)<br />[XGCreateBVHComputer2](/zh-TW/reference/graphics/xg_xs/functions/xgcreatebvhcomputer2_xs)<br />[DecompressBVH](/zh-TW/reference/graphics/xg_xs/interfaces/XGBVHComputer/methods/xgbvhcomputer_decompressbvh_xs)<br />[GetRequiredGpuScratchSizeInBytes](/zh-TW/reference/graphics/xg_xs/interfaces/XGBVHComputer/methods/xgbvhcomputer_getrequiredgpuscratchsizeinbytes_xs)


## Related topics

- [NDA topic directory - live Microsoft Learn links](/nda/nda-topic-directory.md)
- [NDA 토픽 디렉터리 - Microsoft Learn 라이브 링크](/ko/nda/nda-topic-directory.md)
- [Répertoire des rubriques NDA : liens actifs vers Microsoft Learn](/fr-CA/nda/nda-topic-directory.md)
- [Directorio de temas NDA: enlaces activos a Microsoft Learn](/es/nda/nda-topic-directory.md)
- [Diretório de tópicos NDA: links ativos do Microsoft Learn](/pt-BR/nda/nda-topic-directory.md)
