> ## Documentation Index
> Fetch the complete documentation index at: https://docs.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](https://docs.xbox.com/reference/graphics/d3d12_x/structs/d3d12_graphics_pipeline_state_desc.md) 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](https://docs.xbox.com/reference/graphics/d3d12_xs/interfaces/ID3D12PipelineState/id3d12pipelinestate_xs.md) object. Typically set this, and the following parameter, with the macro `IID_PPV_ARGS(&PSO1)`, where *PSO1* 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](https://docs.xbox.com/reference/graphics/d3d12/interfaces/id3d12device1/methods/id3d12device1_createpipelinelibrary_public.md).

## 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](https://docs.xbox.com/reference/graphics/d3d12/interfaces/id3d12pipelinelibrary/id3d12pipelinelibrary_public.md)


## Related topics

- [LoadPipeline](https://docs.xbox.com/reference/graphics/d3d12/interfaces/id3d12pipelinelibrary1/methods/id3d12pipelinelibrary1_loadpipeline_public.md)
- [CreatePipelineLibrary](https://docs.xbox.com/reference/graphics/d3d12/interfaces/id3d12device1/methods/id3d12device1_createpipelinelibrary_public.md)
- [LoadComputePipeline](https://docs.xbox.com/reference/graphics/d3d12/interfaces/id3d12pipelinelibrary/methods/id3d12pipelinelibrary_loadcomputepipeline_public.md)
- [ID3D12PipelineLibrary1](https://docs.xbox.com/reference/graphics/d3d12/interfaces/id3d12pipelinelibrary1/id3d12pipelinelibrary1_public.md)
- [Load](https://docs.xbox.com/reference/system/Wrappers/classes/provider/methods/xgamesave_wrapper_provider_load.md)
