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

# RetrieveCounterDataX (XBOX One 系列)

> 指示 GPU 將先前取樣的計數器值寫入 C++ 結構。

指示 GPU 將先前取樣的計數器值寫入 C++ 結構。

## 語法

```cpp theme={null}
HRESULT RetrieveCounterDataX(  
         ID3D12Resource* pSourceBuffer,
         UINT64 AlignedSourceBufferOffset,
         D3D12XBOX_COUNTER_DATA* pCounterData
)  
```

### 參數

*pSourceBuffer*   \_In\_\
類型：[ID3D12Resource\*](/zh-TW/reference/graphics/d3d12_x/interfaces/id3d12resource/id3d12resource)

要從中擷取計數器值的緩衝區。此緩衝區應已在先前呼叫 [ID3D12GraphicsCommandList::SampleCountersX](/zh-TW/reference/graphics/d3d12_x/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_samplecountersx) 時使用過。

*AlignedSourceBufferOffset*   \_In\_\
類型：UINT64

要從中擷取計數器值的位移。此位移應已在先前呼叫 [ID3D12GraphicsCommandList::SampleCountersX](/zh-TW/reference/graphics/d3d12_x/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_samplecountersx) 時使用過。

*pCounterData*   \_Out\_\
類型：[D3D12XBOX\_COUNTER\_DATA\*](/zh-TW/reference/graphics/d3d12_x/structs/d3d12xbox_counter_data)

接收計數器值的 C++ 結構。

### 傳回值

類型：HRESULT

其中一個 [Direct3D 12 傳回碼](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/d3d12-graphics-reference-returnvalues)。

## 需求

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

**程式庫：** d3d12\_x.lib

**支援的平台：** XBOX One 系列

## 另請參閱

[ID3D12XboxCounterSet](/zh-TW/reference/graphics/d3d12_x/interfaces/id3d12xboxcounterset/id3d12xboxcounterset)


## Related topics

- [PIXReportCounter](/zh-TW/reference/tools/pix3/functions/pixreportcounter.md)
- [NDA 主題目錄 - Microsoft Learn 線上連結](/zh-TW/nda/nda-topic-directory.md)
- [AsyncProviderData](/zh-TW/reference/system/xasyncprovider/structs/xasyncproviderdata.md)
- [game_chat_data_frame](/zh-TW/reference/chat/gamechat2/structs/game_chat_data_frame.md)
- [XStoreCollectionData](/zh-TW/reference/system/xstore/structs/xstorecollectiondata.md)
