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

> Retrieves the requested PSO from the library. The input desc is matched against the data in the current library database, and remembered in order to prevent.

Retrieves the requested PSO from the library. The input desc is matched against the data in the current library database, and remembered in order to prevent duplication of PSO contents.

## Syntax

```cpp theme={null}
HRESULT LoadComputePipeline(
    LPCWSTR pName,
    const D3D12_COMPUTE_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\_COMPUTE\_PIPELINE\_STATE\_DESC \*

Specifies a description of the required PSO in a [D3D12\_COMPUTE\_PIPELINE\_STATE\_DESC](/reference/graphics/d3d12/structs/d3d12_compute_pipeline_state_desc_public) 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)
- [LoadGraphicsPipeline](/reference/graphics/d3d12/interfaces/id3d12pipelinelibrary/methods/id3d12pipelinelibrary_loadgraphicspipeline_public.md)
- [CreateComputePipelineState](/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_createcomputepipelinestate_public.md)
- [D3D12_COMPUTE_PIPELINE_STATE_DESC](/reference/graphics/d3d12/structs/d3d12_compute_pipeline_state_desc_public.md)
