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

# PrefetchPipelineStateX (XBOX One 系列)

> PrefetchPipelineStateX (XBOX One 系列主機) — 預先擷取指定的管線狀態。適用於 XBOX 遊戲開發的 Direct3D 12 圖形 API 參考。

將指定管線狀態中的著色器程式二進位檔預先擷取至圖形第 2 層快取。

## 語法

```cpp theme={null}
void PrefetchPipelineStateX(  
         ID3D12PipelineState* pPipelineState,  
         UINT64 ShaderPrefetchSizeBytes,  
         D3D12XBOX_PREFETCH_PIPELINE_STATE_FLAGS PipelineStateFlags,  
         D3D12XBOX_PREFETCH_MEMORY_FLAGS Flags  
)  
```

### 參數

*pPipelineState*   \_In\_\
類型：ID3D12PipelineState\*

要擷取的管線狀態物件。

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

要從管線狀態物件內每個所選著色器程式開頭預先擷取的記憶體數量 (以位元組為單位)。

*PipelineStateFlags*   \_In\_\
類型：[D3D12XBOX\_PREFETCH\_PIPELINE\_STATE\_FLAGS](/zh-TW/reference/graphics/d3d12_x/enums/d3d12xbox_prefetch_pipeline_state_flags)

選取管線狀態物件中應預先擷取哪些著色器程式的旗標。

*Flags*   \_In\_\
類型：[D3D12XBOX\_PREFETCH\_MEMORY\_FLAGS](/zh-TW/reference/graphics/d3d12_x/enums/d3d12xbox_prefetch_memory_flags)

控制預先擷取作業性質的旗標。

### 傳回值

類型：void

## 備註

PrefetchPipelineStateX 的實作實際上會針對管線狀態物件中每個所選的著色器程式呼叫一次 [PrefetchMemoryX](/zh-TW/reference/graphics/d3d12_x/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_prefetchmemoryx) API，並使用著色器程式的基底位址以及 ShaderPrefetchSizeBytes 參數所指定的大小。

## 需求

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

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

**支援的平台：** XBOX One 系列主機和 XBOX Series 主機

## 另請參閱

[PrefetchMemoryX](/zh-TW/reference/graphics/d3d12_x/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_prefetchmemoryx)

[ID3D12GraphicsCommandList](/zh-TW/reference/graphics/d3d12_x/interfaces/id3d12graphicscommandlist/id3d12graphicscommandlist)


## Related topics

- [SetPipelineState](/zh-CN/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_setpipelinestate_public.md)
- [CreateGraphicsPipelineState](/zh-CN/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_creategraphicspipelinestate_public.md)
- [CreateComputePipelineState](/zh-CN/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_createcomputepipelinestate_public.md)
- [D3D12_CACHED_PIPELINE_STATE](/zh-CN/reference/graphics/d3d12/structs/d3d12_cached_pipeline_state_public.md)
- [D3D12_COMPUTE_PIPELINE_STATE_DESC](/zh-CN/reference/graphics/d3d12/structs/d3d12_compute_pipeline_state_desc_public.md)
