D3D12_DEPTH_STENCIL_VIEW_DESC structure (d3d12.h)

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

Syntax

typedef struct D3D12_DEPTH_STENCIL_VIEW_DESC {
  DXGI_FORMAT         Format;
  D3D12_DSV_DIMENSION ViewDimension;
  D3D12_DSV_FLAGS     Flags;
  union {
    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

A DXGI_FORMAT-typed value that specifies the viewing format. For allowable formats, see Remarks.

ViewDimension

A D3D12_DSV_DIMENSION-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

A combination of D3D12_DSV_FLAGS 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

A D3D12_TEX1D_DSV structure that specifies a 1D texture subresource.

Texture1DArray

A D3D12_TEX1D_ARRAY_DSV structure that specifies an array of 1D texture subresources.

Texture2D

A D3D12_TEX2D_DSV structure that specifies a 2D texture subresource.

Texture2DArray

A D3D12_TEX2D_ARRAY_DSV structure that specifies an array of 2D texture subresources.

Texture2DMS

A D3D12_TEX2DMS_DSV structure that specifies a multisampled 2D texture.

Texture2DMSArray

A D3D12_TEX2DMS_ARRAY_DSV structure that specifies an array of multisampled 2D textures.

Remarks

These are valid formats for a depth-stencil view:

  • DXGI_FORMAT_D16_UNORM
  • DXGI_FORMAT_D24_UNORM_S8_UINT
  • DXGI_FORMAT_D32_FLOAT
  • DXGI_FORMAT_D32_FLOAT_S8X24_UINT
  • DXGI_FORMAT_UNKNOWN
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 to create a depth-stencil view.

Requirements

Requirement Value
Header d3d12.h

See also

Core Structures