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

# WritePRTLODStatisticsX (XBOX Series 主機)

> 將 PRT LOD 統計資料報告寫入記憶體緩衝區。

將 PRT LOD 統計資料報告寫入記憶體緩衝區。此報告包含已由 PRT LOD 硬體標記為追蹤之資源的 mip LOD 取樣計數與限制相關資訊。

## 語法

```cpp theme={null}
void WritePRTLODStatisticsX(  
         const D3D12XBOX_PRT_LOD_REPORT_DESC* pReport  
)  
```

### 參數

*pReport*   \_In\_\
類型：const [D3D12XBOX\_PRT\_LOD\_REPORT\_DESC](/zh-TW/reference/graphics/d3d12_xs/structs/d3d12xbox_prt_lod_report_desc)\*

報告在圖形記憶體中之目的地位址與大小的參數，以及是否要在產生報告時重設取樣計數的控制項。

## 備註

在 GPU 時間軸上執行此 API 時，PRT LOD 硬體會將報告寫入記憶體。根據緩衝區的輸入大小，硬體會自動對輸出進行多重緩衝處理，以便執行正確的同步處理。

緩衝區的輸入大小必須符合 N \* 2 KB + 64 位元組的公式，其中 N 至少為 2。N 的值定義多重緩衝處理的數量 (亦即 N 為 2 表示雙重緩衝，N 為 3 表示三重緩衝)。建議將 PRT LOD 報告放在專為 CPU 回讀設計的圖形記憶體類型中，例如 XALLOC\_MEMTYPE\_GRAPHICS\_CACHEABLE 或 XALLOC\_MEMTYPE\_GRAPHICS\_GPU\_UNCACHED。

報告由三個部分組成：8 位元組的標頭、56 位元組的填補，以及 8 位元組取樣的陣列。標頭的配置由 [D3D12XBOX\_PRT\_LOD\_REPORT\_GPU\_HEADER](/zh-TW/reference/graphics/d3d12_xs/structs/d3d12xbox_prt_lod_report_gpu_header) 結構定義。每個取樣由 [D3D12XBOX\_PRT\_LOD\_REPORT\_GPU\_SAMPLE](/zh-TW/reference/graphics/d3d12_xs/structs/d3d12xbox_prt_lod_report_gpu_sample) 結構定義。

每次寫入報告時，標頭都會更新，以反映最近寫入的 256 個取樣集的位置。標頭中的 SampleOffset 參數以 32 位元組為增量，表示最近一次報告所寫入之第一個取樣的位置。例如，如果 SampleOffset 為 2，則第一個取樣位於距離報告緩衝區基底位址 64 位元組處。

每個取樣表示從已標記的著色器資源檢視 (使用 [ID3D12Device8::SetShaderResourceViewPRTLODIndexX](/zh-TW/reference/graphics/d3d12_xs/interfaces/ID3D12Device8/methods/id3d12device8_setshaderresourceviewprtlodindexx) API) 擷取的結果。如需如何解讀結果的詳細資訊，請參閱 [D3D12XBOX\_PRT\_LOD\_REPORT\_GPU\_SAMPLE](/zh-TW/reference/graphics/d3d12_xs/structs/d3d12xbox_prt_lod_report_gpu_sample) 主題。

## 需求

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

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

## 另請參閱

[ID3D12Device8::SetShaderResourceViewPRTLODIndexX](/zh-TW/reference/graphics/d3d12_xs/interfaces/ID3D12Device8/methods/id3d12device8_setshaderresourceviewprtlodindexx)\
[ID3D12GraphicsCommandList6](/zh-TW/reference/graphics/d3d12_xs/interfaces/ID3D12GraphicsCommandList6/id3d12graphicscommandlist6)


## Related topics

- [XBOX Series X|S 總覽](/zh-TW/paths/series-xs/overview.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)
- [XR-130 XBOX Series X|S 世代](/zh-TW/publishing/certification/xr/xr-130.md)
