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

# LoadGraphicsPipeline

> Retrieves the requested PSO from the library.

Retrieves the requested PSO from the library.

## Syntax

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

### Parameters

*pName \[in]*\
Type: LPCWSTR

The unique name of the PSO.

*pDesc \[in]*\
Type: const D3D12\_GRAPHICS\_PIPELINE\_STATE\_DESC \*

Specifies a description of the required PSO in a [D3D12\_GRAPHICS\_PIPELINE\_STATE\_DESC](/reference/graphics/d3d12_x/structs/d3d12_graphics_pipeline_state_desc) structure. This input description is matched against the data in the current library database, and stored in order to prevent duplication of PSO contents.

*riid*\
Type: const IID &

Specifies a REFIID for the [ID3D12PipelineState](/reference/graphics/d3d12_xs/interfaces/ID3D12PipelineState/id3d12pipelinestate_xs) object. Typically set this, and the following parameter, with the macro <code>IID\_PPV\_ARGS(\&PSO1)</code>, where <i>PSO1</i> is the name of the object.

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

Specifies a pointer that will reference the returned PSO.

### 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 if the input description doesn't match the data in the library, and E\_OUTOFMEMORY if unable to allocate the return PSO.

## Remarks

Refer to the remarks and examples for [CreatePipelineLibrary](/reference/graphics/d3d12/interfaces/id3d12device1/methods/id3d12device1_createpipelinelibrary_public).

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

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


## Related topics

- [LoadPipeline](/reference/graphics/d3d12/interfaces/id3d12pipelinelibrary1/methods/id3d12pipelinelibrary1_loadpipeline_public.md)
- [CreatePipelineLibrary](/reference/graphics/d3d12/interfaces/id3d12device1/methods/id3d12device1_createpipelinelibrary_public.md)
- [LoadComputePipeline](/reference/graphics/d3d12/interfaces/id3d12pipelinelibrary/methods/id3d12pipelinelibrary_loadcomputepipeline_public.md)
- [ID3D12PipelineLibrary1](/reference/graphics/d3d12/interfaces/id3d12pipelinelibrary1/id3d12pipelinelibrary1_public.md)
- [CreateGraphicsPipelineState](/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_creategraphicspipelinestate_public.md)
