> ## 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](/reference/graphics/d3d12_x/structs/d3d12_graphics_pipeline_state_desc) 结构和 [D3D12\_COMPUTE\_PIPELINE\_STATE\_DESC](/reference/graphics/d3d12/structs/d3d12_compute_pipeline_state_desc_public) 结构使用。

此结构旨在填充从 [ID3D12PipelineState::GetCachedBlob](/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-CN/reference/graphics/d3d12/structs/d3d12_compute_pipeline_state_desc_public.md)
- [GetCachedBlob](/zh-CN/reference/graphics/d3d12/interfaces/id3d12pipelinestate/methods/id3d12pipelinestate_getcachedblob_public.md)
- [D3D12_PIPELINE_STATE_STREAM_DESC](/zh-CN/reference/graphics/d3d12/structs/d3d12_pipeline_state_stream_desc_public.md)
- [D3D12_STATE_OBJECT_TYPE](/zh-CN/reference/graphics/d3d12/enums/d3d12_state_object_type_public.md)
- [D3D12_STATE_SUBOBJECT_TYPE](/zh-CN/reference/graphics/d3d12/enums/d3d12_state_subobject_type_public.md)
