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

# D3D12_CLEAR_VALUE

> Describes a value used to optimize clear operations for a particular resource.

Describes a value used to optimize clear operations for a particular resource.

## Syntax

```cpp theme={null}
typedef struct D3D12_CLEAR_VALUE
{
    DXGI_FORMAT Format;
    FLOAT Color;
    D3D12_DEPTH_STENCIL_VALUE DepthStencil;
} D3D12_CLEAR_VALUE
```

### Members

*Format*\
Type: DXGI\_FORMAT

Specifies one member of the [DXGI\_FORMAT](https://learn.microsoft.com/en-us/windows/desktop/api/dxgiformat/ne-dxgiformat-dxgi_format) enum.

The format of the commonly cleared color follows the same validation rules as a view/ descriptor creation. In general, the format of the clear color can be any format in the same typeless group that the resource format belongs to.

This <i>Format</i> must match the format of the view used during the clear operation. It indicates whether the <i>Color</i> or the <i>DepthStencil</i> member is valid and how to convert the values for usage with the resource.

*Color*\
Type: FLOAT\[4]

Specifies a 4-entry array of float values, determining the RGBA value. The order of RGBA matches the order used with [ClearRenderTargetView](/reference/graphics/d3d12_xs/interfaces/ID3D12GraphicsCommandList/methods/id3d12graphicscommandlist_clearrendertargetview_xs).

*DepthStencil*\
Type: D3D12\_DEPTH\_STENCIL\_VALUE

Specifies one member of [D3D12\_DEPTH\_STENCIL\_VALUE](/reference/graphics/d3d12/structs/d3d12_depth_stencil_value_public). These values match the semantics of <i>Depth</i> and <i>Stencil</i> in [ClearDepthStencilView](/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_cleardepthstencilview_public).

## Remarks

This structure is optionally passed into the following methods:

<ul>
  <li>
    [ID3D12Device::CreateCommittedResource](/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_createcommittedresource_public)
  </li>

  <li>
    [ID3D12Device::CreatePlacedResource](/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_createplacedresource_public)
  </li>

  <li>
    [ID3D12Device::CreateReservedResource](/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_createreservedresource_public)
  </li>
</ul>

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

[CD3DX12\_CLEAR\_VALUE](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/cd3dx12-clear-value)

[Core Structures](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/direct3d-12-structures)


## Related topics

- [D3D12_RENDER_PASS_BEGINNING_ACCESS_CLEAR_PARAMETERS](/reference/graphics/d3d12/structs/d3d12_render_pass_beginning_access_clear_parameters_public.md)
- [D3D12_DEPTH_STENCIL_VALUE](/reference/graphics/d3d12/structs/d3d12_depth_stencil_value_public.md)
- [CreateReservedResource](/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_createreservedresource_public.md)
- [CreateReservedResource1 (XBOX Series consoles)](/reference/graphics/d3d12/interfaces/id3d12device4/methods/id3d12device4_createreservedresource1_public.md)
- [CreateReservedResource2 (XBOX Series consoles)](/reference/graphics/d3d12/interfaces/id3d12device10/methods/id3d12device10_createreservedresource2_public.md)
