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

# D3D12_CACHED_PIPELINE_STATE

> 儲存管線狀態。

儲存管線狀態。

## 語法

```cpp theme={null}
typedef struct D3D12_CACHED_PIPELINE_STATE
{
    const void  pCachedBlob;
    SIZE_T CachedBlobSizeInBytes;
} D3D12_CACHED_PIPELINE_STATE
```

### 成員

*pCachedBlob*\
類型：const void \*

指定參考快取記憶體位置的指標。

*CachedBlobSizeInBytes*\
類型：SIZE\_T

指定快取的大小 (以位元組為單位)。

## 備註

此結構由 [D3D12\_GRAPHICS\_PIPELINE\_STATE\_DESC](/zh-TW/reference/graphics/d3d12_x/structs/d3d12_graphics_pipeline_state_desc) 結構與 [D3D12\_COMPUTE\_PIPELINE\_STATE\_DESC](/zh-TW/reference/graphics/d3d12/structs/d3d12_compute_pipeline_state_desc_public) 結構使用。

此結構旨在填入從 [ID3D12PipelineState::GetCachedBlob](/zh-TW/reference/graphics/d3d12/interfaces/id3d12pipelinestate/methods/id3d12pipelinestate_getcachedblob_public) 擷取的資料。此快取的 PSO 包含其擷取來源之硬體、驅動程式與電腦所特有的資料。使用此資料進行編譯應會比不使用時更快。PSO 中的其餘資料仍必須有效，且必須與快取的 PSO 相符，否則可能會傳回 E\_INVALIDARG。

如果在快取 PSO 之後，驅動程式已升級為 D3D12 驅動程式，您可能會看到 D3D12\_ERROR\_DRIVER\_VERSION\_MISMATCH 傳回碼；如果您在不同的 GPU 上執行，則可能會看到 D3D12\_ERROR\_ADAPTER\_NOT\_FOUND 傳回碼。

## 需求

**標頭:** d3d12\_xs.h 或 d3d12\_x.h\
**程式庫:** d3d12\_xs.lib 或 d3d12\_x.lib\
**支援的平台**: XBOX Series 主機與 XBOX One 系列

## 另請參閱

[核心結構](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/direct3d-12-structures)


## Related topics

- [D3D12_COMPUTE_PIPELINE_STATE_DESC](/zh-TW/reference/graphics/d3d12/structs/d3d12_compute_pipeline_state_desc_public.md)
- [GetCachedBlob](/zh-TW/reference/graphics/d3d12/interfaces/id3d12pipelinestate/methods/id3d12pipelinestate_getcachedblob_public.md)
- [D3D12_PIPELINE_STATE_STREAM_DESC](/zh-TW/reference/graphics/d3d12/structs/d3d12_pipeline_state_stream_desc_public.md)
- [D3D12_STATE_OBJECT_TYPE](/zh-TW/reference/graphics/d3d12/enums/d3d12_state_object_type_public.md)
- [D3D12_STATE_SUBOBJECT_TYPE](/zh-TW/reference/graphics/d3d12/enums/d3d12_state_subobject_type_public.md)
