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

# ClearState

> Resets the state of a direct command list back to the state it was in when the command list was created. (ID3D12GraphicsCommandList.ClearState)

Resets the state of a direct command list back to the state it was in when the command list was created.

## Syntax

```cpp theme={null}
void ClearState(
    ID3D12PipelineState  pPipelineState
)
```

### Parameters

*pPipelineState \[in, optional]*\
Type: ID3D12PipelineState \*

A pointer to the [ID3D12PipelineState](/reference/graphics/d3d12_xs/interfaces/ID3D12PipelineState/id3d12pipelinestate_xs) object that contains the initial pipeline state for the command list.

### Return value

Type: void

None.

## Remarks

It is invalid to call **ClearState** on a bundle.  If an app calls **ClearState** on a bundle, the call to [Close](/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_close_public) will return **E\_FAIL**.

When **ClearState** is called, all currently bound resources are unbound.  The primitive topology is set to [D3D\_PRIMITIVE\_TOPOLOGY\_UNDEFINED](https://learn.microsoft.com/en-us/windows/desktop/api/d3dcommon/ne-d3dcommon-d3d_primitive_topology).  Viewports, scissor rectangles, stencil reference value, and the blend factor are set to empty values (all zeros).  Predication is disabled.

The app-provided pipeline state object becomes bound as the currently set pipeline state object.

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

[ID3D12GraphicsCommandList](/reference/graphics/d3d12_xs/interfaces/ID3D12GraphicsCommandList/id3d12graphicscommandlist_xs)


## Related topics

- [D3D12_META_COMMAND_DESC](/reference/graphics/d3d12/structs/d3d12_meta_command_desc_public.md)
- [ClearUnorderedAccessViewFloat](/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_clearunorderedaccessviewfloat_public.md)
- [ClearUnorderedAccessViewUint](/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_clearunorderedaccessviewuint_public.md)
- [CreateCommittedResource](/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_createcommittedresource_public.md)
- [CreateReservedResource](/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_createreservedresource_public.md)
