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

> Describes the subresources of a texture that are accessible from a depth-stencil view.

Describes the subresources of a texture that are accessible from a depth-stencil view.

## Syntax

```cpp theme={null}
typedef struct D3D12_DEPTH_STENCIL_VIEW_DESC
{
    DXGI_FORMAT Format;
    D3D12_DSV_DIMENSION ViewDimension;
    D3D12_DSV_FLAGS Flags;
    D3D12_TEX1D_DSV Texture1D;
    D3D12_TEX1D_ARRAY_DSV Texture1DArray;
    D3D12_TEX2D_DSV Texture2D;
    D3D12_TEX2D_ARRAY_DSV Texture2DArray;
    D3D12_TEX2DMS_DSV Texture2DMS;
    D3D12_TEX2DMS_ARRAY_DSV Texture2DMSArray;
} D3D12_DEPTH_STENCIL_VIEW_DESC
```

### Members

*Format*\
Type: DXGI\_FORMAT

A [DXGI\_FORMAT](https://learn.microsoft.com/en-us/windows/desktop/api/dxgiformat/ne-dxgiformat-dxgi_format)-typed value that specifies the viewing format.  For allowable formats, see Remarks.

*ViewDimension*\
Type: D3D12\_DSV\_DIMENSION

A [D3D12\_DSV\_DIMENSION](/reference/graphics/d3d12/enums/d3d12_dsv_dimension_public)-typed value that specifies how the depth-stencil resource will be accessed. This member also determines which \_DSV to use in the following union.

*Flags*\
Type: D3D12\_DSV\_FLAGS

A combination of [D3D12\_DSV\_FLAGS](/reference/graphics/d3d12/enums/d3d12_dsv_flags_public) enumeration constants that are combined by using a bitwise OR operation.
The resulting value specifies whether the texture is read only.
Pass 0 to specify that it isn't read only; otherwise, pass one or more of the members of the **D3D12\_DSV\_FLAGS** enumerated type.

*Texture1D*\
Type: D3D12\_TEX1D\_DSV

A [D3D12\_TEX1D\_DSV](/reference/graphics/d3d12/structs/d3d12_tex1d_dsv_public) structure that specifies a 1D texture subresource.

*Texture1DArray*\
Type: D3D12\_TEX1D\_ARRAY\_DSV

A [D3D12\_TEX1D\_ARRAY\_DSV](/reference/graphics/d3d12/structs/d3d12_tex1d_array_dsv_public) structure that specifies an array of 1D texture subresources.

*Texture2D*\
Type: D3D12\_TEX2D\_DSV

A [D3D12\_TEX2D\_DSV](/reference/graphics/d3d12/structs/d3d12_tex2d_dsv_public) structure that specifies a 2D texture subresource.

*Texture2DArray*\
Type: D3D12\_TEX2D\_ARRAY\_DSV

A [D3D12\_TEX2D\_ARRAY\_DSV](/reference/graphics/d3d12/structs/d3d12_tex2d_array_dsv_public) structure that specifies an array of 2D texture subresources.

*Texture2DMS*\
Type: D3D12\_TEX2DMS\_DSV

A [D3D12\_TEX2DMS\_DSV](/reference/graphics/d3d12/structs/d3d12_tex2dms_dsv_public) structure that specifies a multisampled 2D texture.

*Texture2DMSArray*\
Type: D3D12\_TEX2DMS\_ARRAY\_DSV

A [D3D12\_TEX2DMS\_ARRAY\_DSV](/reference/graphics/d3d12/structs/d3d12_tex2dms_array_dsv_public) structure that specifies an array of multisampled 2D textures.

## Remarks

These are valid formats for a depth-stencil view:

<ul>
  <li>DXGI\_FORMAT\_D16\_UNORM</li>
  <li>DXGI\_FORMAT\_D24\_UNORM\_S8\_UINT</li>
  <li>DXGI\_FORMAT\_D32\_FLOAT</li>
  <li>DXGI\_FORMAT\_D32\_FLOAT\_S8X24\_UINT</li>
  <li>DXGI\_FORMAT\_UNKNOWN</li>
</ul>

A depth-stencil view can't use a typeless format.  If the format chosen is DXGI\_FORMAT\_UNKNOWN, the format of the parent resource is used.

Pass a depth-stencil-view description into [ID3D12Device::CreateDepthStencilView](/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_createdepthstencilview_public) to create a depth-stencil view.

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

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