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

# LoadPipeline

> 从库中检索请求的 PSO。管线流描述与库数据库匹配，并被记住以防止。

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

## 语法

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

### 参数

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

[SAL](https://learn.microsoft.com/en-us/cpp/code-quality/annotating-function-parameters-and-return-values)：<code>*In*</code>

PSO 的唯一名称。

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

[SAL](https://learn.microsoft.com/en-us/cpp/code-quality/annotating-function-parameters-and-return-values)：<code>*In*</code>

使用 [D3D12\_PIPELINE\_STATE\_STREAM\_DESC](/reference/graphics/d3d12/structs/d3d12_pipeline_state_stream_desc_public) 结构描述所需的 PSO。此描述与库数据库匹配并存储，以防止 PSO 内容重复。

*riid*\
类型：const IID &

指定 ID3D12PipelineStateState 对象的 REFIID。

应用程序通常应使用宏 IID\_PPV\_ARGS(\&PSO1) 设置此参数以及以下参数 ppPipelineState，其中 PSO1 是对象的名称。

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

[SAL](https://learn.microsoft.com/en-us/cpp/code-quality/annotating-function-parameters-and-return-values)：<code>*COM\_Outptr*</code>

指定在函数成功返回后将引用 PSO 的指针。

### 返回值

类型：HRESULT

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

## 备注

此函数将管线描述作为 [D3D12\_PIPELINE\_STATE\_STREAM\_DESC](/reference/graphics/d3d12/structs/d3d12_pipeline_state_stream_desc_public)，可替代 [ID3D12PipelineLibrary::LoadGraphicsPipeline](/reference/graphics/d3d12/interfaces/id3d12pipelinelibrary/methods/id3d12pipelinelibrary_loadgraphicspipeline_public) 和 [ID3D12PipelineLibrary::LoadComputePipeline](/reference/graphics/d3d12/interfaces/id3d12pipelinelibrary/methods/id3d12pipelinelibrary_loadcomputepipeline_public) 函数，这些函数分别以较不灵活的 [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) 结构作为其管线描述。

## 要求

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

## 另请参阅

有关流式管线描述的布局和行为的说明，请参阅 [D3D12\_PIPELINE\_STATE\_STREAM\_DESC](/reference/graphics/d3d12/structs/d3d12_pipeline_state_stream_desc_public)。

[ID3D12PipelineLibrary1](/reference/graphics/d3d12/interfaces/id3d12pipelinelibrary1/id3d12pipelinelibrary1_public)


## Related topics

- [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)
- [LoadComputePipeline](/zh-CN/reference/graphics/d3d12/interfaces/id3d12pipelinelibrary/methods/id3d12pipelinelibrary_loadcomputepipeline_public.md)
- [Load](/zh-CN/reference/system/Wrappers/classes/provider/methods/xgamesave_wrapper_provider_load.md)
- [ACP_COMMAND_LOAD_SHAPE_FLOWGRAPH](/zh-CN/reference/audio/acphal/structs/acp_command_load_shape_flowgraph.md)
