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

> Retrieves the requested PSO from the library. The pipeline stream description is matched against the library database and remembered in order to prevent.

Retrieves the requested PSO from the library. The pipeline stream description is matched against the library database and remembered in order to prevent duplication of PSO contents.

## Syntax

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

### Parameters

*pName \[in]*\
Type: LPCWSTR

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

The unique name of the PSO.

*pDesc \[in]*\
Type: 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>

Describes the required PSO using a [D3D12\_PIPELINE\_STATE\_STREAM\_DESC](/reference/graphics/d3d12/structs/d3d12_pipeline_state_stream_desc_public) structure. This description is matched against the library database and stored in order to prevent duplication of PSO contents.

*riid*\
Type: const IID &

Specifies a REFIID for the ID3D12PipelineStateState object.

Applications should typically set this argument and the following argument, ppPipelineState, by using the macro IID\_PPV\_ARGS(\&PSO1), where PSO1 is the name of the object.

*ppPipelineState \[out]*\
Type: void \*\*

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

Specifies the pointer that will reference the PSO after the function successfully returns.

### Return value

Type: HRESULT

This method returns an HRESULT success or error code, which can include E\_INVALIDARG if the name doesn't exist or the stream description doesn't match the data in the library, and E\_OUTOFMEMORY if the function is unable to allocate the resulting PSO.

## Remarks

This function takes the pipeline description as a [D3D12\_PIPELINE\_STATE\_STREAM\_DESC](/reference/graphics/d3d12/structs/d3d12_pipeline_state_stream_desc_public) and is a replacement for the [ID3D12PipelineLibrary::LoadGraphicsPipeline](/reference/graphics/d3d12/interfaces/id3d12pipelinelibrary/methods/id3d12pipelinelibrary_loadgraphicspipeline_public) and [ID3D12PipelineLibrary::LoadComputePipeline](/reference/graphics/d3d12/interfaces/id3d12pipelinelibrary/methods/id3d12pipelinelibrary_loadcomputepipeline_public) functions, which take their pipeline description as the less-flexible [D3D12\_GRAPHICS\_PIPELINE\_STATE\_DESC](/reference/graphics/d3d12_x/structs/d3d12_graphics_pipeline_state_desc) and [D3D12\_COMPUTE\_PIPELINE\_STATE\_DESC](/reference/graphics/d3d12/structs/d3d12_compute_pipeline_state_desc_public) structs, respectively.

## Requirements

**Header:** d3d12\_xs.h or d3d12\_x.h\
**Library:** d3d12\_xs.lib or d3d12\_x.lib\
**Supported Platforms**: XBOX Series consoles and XBOX One family

## See Also

See [D3D12\_PIPELINE\_STATE\_STREAM\_DESC](/reference/graphics/d3d12/structs/d3d12_pipeline_state_stream_desc_public) for a description of the layout and behavior of a streaming pipeline desc.

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