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

# CreateCounterSetX (XBOX One 系列)

> 建立一組可取樣的 GPU 硬體計數器。

建立一組可取樣的 GPU 硬體計數器。

## 語法

```cpp theme={null}
HRESULT CreateComputePipelineStateX(  
         const D3D12XBOX_COUNTER_SET_DESC* pCounterSetDesc,  
         REFIID riid,  
         void** ppCounterSet  
)  
```

### 參數

*pCounterSetDesc*   \_In\_<br />類型：[D3D12XBOX\_COUNTER\_SET\_DESC\*](/zh-TW/reference/graphics/d3d12_x/structs/d3d12xbox_counter_set_desc)

計數器集合描述的位址。

*riid*   <br />類型：REFIID

計數器集合介面 [ID3D12XboxCounterSet](/zh-TW/reference/graphics/d3d12_x/interfaces/id3d12xboxcounterset/id3d12xboxcounterset) 的全域唯一識別碼 (GUID)。

若要擷取計數器集合的 [REFIID](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-oaut/bbde795f-5398-42d8-9f59-3613da03c318) (或 GUID)，請使用 [\_\_uuidof()](https://learn.microsoft.com/en-us/cpp/cpp/uuidof-operator?view=vs-2019) 巨集。

*ppPipelineState*   \_Outptr\_<br />類型：void\*\*

產生的 [ID3D12XboxCounterSet](/zh-TW/reference/graphics/d3d12_x/interfaces/id3d12xboxcounterset/id3d12xboxcounterset) 物件。

### 傳回值

類型：HRESULT

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

## 備註

[ID3D12GraphicsCommandList::StartCountersX](/zh-TW/reference/graphics/d3d12_x/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_startcountersx) 可以使用產生的計數器集合物件，開始對 GPU 硬體計數器進行取樣。

## 需求

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

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

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

## 另請參閱

[D3D12XBOX\_COUNTER\_SET\_DESC](/zh-TW/reference/graphics/d3d12_x/structs/d3d12xbox_counter_set_desc)

[ID3D12Device](/zh-TW/reference/graphics/d3d12_x/interfaces/id3d12device/id3d12device)

[ID3D12GraphicsCommandList::StartCountersX](/zh-TW/reference/graphics/d3d12_x/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_startcountersx)


## Related topics

- [PIXReportCounter](/zh-CN/reference/tools/pix3/functions/pixreportcounter.md)
- [NDA 主題目錄 - Microsoft Learn 線上連結](/zh-TW/nda/nda-topic-directory.md)
- [CreateFence](/zh-CN/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_createfence_public.md)
- [CreateHeap](/zh-CN/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_createheap_public.md)
- [CreateSampler](/zh-CN/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_createsampler_public.md)
