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

> 從程式庫擷取所要求的 PSO。

從程式庫擷取所要求的 PSO。

## 語法

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

### 參數

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

PSO 的唯一名稱。

*pDesc \[in]*\
類型：const D3D12\_GRAPHICS\_PIPELINE\_STATE\_DESC \*

在 [D3D12\_GRAPHICS\_PIPELINE\_STATE\_DESC](/zh-TW/reference/graphics/d3d12_x/structs/d3d12_graphics_pipeline_state_desc) 結構中指定所需 PSO 的描述。此輸入描述會與目前程式庫資料庫中的資料進行比對，並加以儲存，以避免 PSO 內容重複。

*riid*\
類型：const IID &

指定 [ID3D12PipelineState](/zh-TW/reference/graphics/d3d12_xs/interfaces/ID3D12PipelineState/id3d12pipelinestate_xs) 物件的 REFIID。通常會使用巨集 <code>IID\_PPV\_ARGS(\&PSO1)</code> 設定此參數和下一個參數，其中 <i>PSO1</i> 是物件的名稱。

*ppPipelineState \[out]*\
類型：void \*\*

指定將參考所傳回 PSO 的指標。

### 傳回值

類型：HRESULT

此方法會傳回 HRESULT 成功或錯誤碼，其中可能包括：如果名稱不存在，或輸入描述與程式庫中的資料不符，則為 E\_INVALIDARG；如果無法配置傳回的 PSO，則為 E\_OUTOFMEMORY。

## 備註

請參閱 [CreatePipelineLibrary](/zh-TW/reference/graphics/d3d12/interfaces/id3d12device1/methods/id3d12device1_createpipelinelibrary_public) 的備註和範例。

## 需求

**標頭:** d3d12\_xs.h 或 d3d12\_x.h\
**程式庫:** d3d12\_xs.lib 或 d3d12\_x.lib\
**支援的平台**: XBOX Series 主機和 XBOX One 系列

## 另請參閱

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


## Related topics

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