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

# LoadComputePipeline

> 从库中检索请求的 PSO。输入描述与当前库数据库中的数据匹配，并被记住以防止。

从库中检索请求的 PSO。输入描述与当前库数据库中的数据匹配，并被记住以防止 PSO 内容重复。

## 语法

```cpp theme={null}
HRESULT LoadComputePipeline(
    LPCWSTR pName,
    const D3D12_COMPUTE_PIPELINE_STATE_DESC  pDesc,
    const IID & riid,
    void  ppPipelineState
)
```

### 参数

*pName \[in]*\
类型：LPCWSTR

PSO 的唯一名称。

*pDesc \[in]*\
类型：const D3D12\_COMPUTE\_PIPELINE\_STATE\_DESC \*

在 [D3D12\_COMPUTE\_PIPELINE\_STATE\_DESC](/reference/graphics/d3d12/structs/d3d12_compute_pipeline_state_desc_public) 结构中指定所需 PSO 的描述。此输入描述会与当前库数据库中的数据匹配，并被存储以防止 PSO 内容重复。

*riid*\
类型：const IID &

指定 [ID3D12PipelineState](/reference/graphics/d3d12_xs/interfaces/ID3D12PipelineState/id3d12pipelinestate_xs) 对象的 REFIID。通常使用宏 <code>IID\_PPV\_ARGS(\&PSO1)</code> 设置此参数和以下参数，其中 <i>PSO1</i> 是对象的名称。

*ppPipelineState \[out]*\
类型：void \*\*

指定将引用返回的 PSO 的指针。

### 返回值

类型：HRESULT

此方法返回一个 HRESULT 成功或错误代码，可能包括 E\_INVALIDARG（如果名称不存在或输入描述与库中的数据不匹配）以及 E\_OUTOFMEMORY（如果无法分配返回的 PSO）。

## 备注

请参阅 [CreatePipelineLibrary](/reference/graphics/d3d12/interfaces/id3d12device1/methods/id3d12device1_createpipelinelibrary_public) 的备注和示例。

## 要求

**头文件：** d3d12\_xs.h 或 d3d12\_x.h\
**库：** d3d12\_xs.lib 或 d3d12\_x.lib\
**支持的平台**：XBOX Series 主机和 XBOX One 系列

## 另请参阅

[ID3D12PipelineLibrary](/reference/graphics/d3d12/interfaces/id3d12pipelinelibrary/id3d12pipelinelibrary_public)


## Related topics

- [LoadPipeline](/zh-CN/reference/graphics/d3d12/interfaces/id3d12pipelinelibrary1/methods/id3d12pipelinelibrary1_loadpipeline_public.md)
- [CreatePipelineLibrary](/zh-CN/reference/graphics/d3d12/interfaces/id3d12device1/methods/id3d12device1_createpipelinelibrary_public.md)
- [LoadGraphicsPipeline](/zh-CN/reference/graphics/d3d12/interfaces/id3d12pipelinelibrary/methods/id3d12pipelinelibrary_loadgraphicspipeline_public.md)
- [CreateComputePipelineState](/zh-CN/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_createcomputepipelinestate_public.md)
- [D3D12_COMPUTE_PIPELINE_STATE_DESC](/zh-CN/reference/graphics/d3d12/structs/d3d12_compute_pipeline_state_desc_public.md)
