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

# CreateGraphicsPipelineState

> Creates a graphics pipeline state object.

Creates a graphics pipeline state object.

## Syntax

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

### Parameters

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

A pointer to a [D3D12\_GRAPHICS\_PIPELINE\_STATE\_DESC](/reference/graphics/d3d12_x/structs/d3d12_graphics_pipeline_state_desc) structure that describes graphics pipeline state.

*riid*\
Type: const IID &

The globally unique identifier (**GUID**) for the pipeline state interface ([ID3D12PipelineState](/reference/graphics/d3d12_xs/interfaces/ID3D12PipelineState/id3d12pipelinestate_xs)).
The **REFIID**, or **GUID**, of the interface to the pipeline state can be obtained by using the \_\_uuidof() macro.
For example, \_\_uuidof(ID3D12PipelineState) will get the **GUID** of the interface to a pipeline state.

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

A pointer to a memory block that receives a pointer to the [ID3D12PipelineState](/reference/graphics/d3d12_xs/interfaces/ID3D12PipelineState/id3d12pipelinestate_xs) interface for the pipeline state object.
The pipeline state object is an immutable state object.  It contains no methods.

### Return value

Type: HRESULT

This method returns **E\_OUTOFMEMORY** if there is insufficient memory to create the pipeline state object.
See [Direct3D 12 Return Codes](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/d3d12-graphics-reference-returnvalues) for other possible return values.

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

[ID3D12Device](/reference/graphics/d3d12_x/interfaces/id3d12device/id3d12device)


## Related topics

- [CreateComputePipelineState](/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_createcomputepipelinestate_public.md)
- [CreatePipelineLibrary](/reference/graphics/d3d12/interfaces/id3d12device1/methods/id3d12device1_createpipelinelibrary_public.md)
- [D3D12_PIPELINE_STATE_STREAM_DESC](/reference/graphics/d3d12/structs/d3d12_pipeline_state_stream_desc_public.md)
- [D3D12_COMPUTE_PIPELINE_STATE_DESC](/reference/graphics/d3d12/structs/d3d12_compute_pipeline_state_desc_public.md)
- [CreateCommandList](/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_createcommandlist_public.md)
