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

# XGCreateBVHComputer2 (XBOX Series 主機)

> XGCreateBVHComputer2 (XBOX Series 主機) — 建立用來解壓縮和還原序列化 BVH 的 BVH 計算器。XBOX 的 Direct3D 12 圖形參考。

建立用來解壓縮和還原序列化 BVH 的 BVH 計算器

## 語法

```cpp theme={null}
HRESULT XGCreateBVHComputer2(  
    _In_  ID3D12Device*   pD3DDevice,
    _Out_ XGBVHComputer** ppComputer
)  
```

### 參數

*pD3DDevice*   \_In\_\
類型：ID3D12Device\*

指向用來建立 GPU 資源之 D3D12 裝置的指標

*ppComputer*   \_Out\_\
類型：XGBVHComputer\*\*

建立的 BVH 計算器

### 傳回值

類型：HRESULT

成功時傳回 **S\_OK**；否則傳回錯誤碼。如需錯誤碼清單，請參閱[錯誤碼](/zh-TW/reference/errorcodes)。可能的錯誤碼值包括下列各項。

## 備註

此 API 是隨 GPU 型 BVH 解壓縮一起推出的。若要使用 DecompressBVH\_BatchedGPU()，必須使用此 API，而不是原始的 XGCreateBVHComputer()。

XGBVHComputer 是參考計數物件，當所有參考都釋放時會自動刪除。

## 需求

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

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

## 另請參閱

[xg\_xs](/zh-TW/reference/graphics/xg_xs/xg_xs_members)\
[XGBVHComputer](/zh-TW/reference/graphics/xg_xs/interfaces/XGBVHComputer/xgbvhcomputer_xs)\
[DecompressBVH\_BatchedGPU](/zh-TW/reference/graphics/xg_xs/interfaces/XGBVHComputer/methods/xgbvhcomputer_decompressbvh_batchedgpu_xs)


## Related topics

- [XBOX Series X|S 總覽](/zh-TW/paths/series-xs/overview.md)
- [使用 GDKX 建置並執行你的第一個主機遊戲](/zh-TW/home/build-first-title/first-console-title-walkthrough.md)
- [XBOX 主機遊戲的認證測試 XBOX 需求](/zh-TW/publishing/certification/console-cert-tested-requirements.md)
- [Play Anywhere(主機 + PC)總覽](/zh-TW/paths/play-anywhere/overview.md)
- [NDA 主題目錄 - Microsoft Learn 線上連結](/zh-TW/nda/nda-topic-directory.md)
