D3D11_DEPTH_STENCIL_VIEW_DESC structure (d3d11.h)

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

Syntax

typedef struct D3D11_DEPTH_STENCIL_VIEW_DESC {
  DXGI_FORMAT         Format;
  D3D11_DSV_DIMENSION ViewDimension;
  UINT                Flags;
  union {
    D3D11_TEX1D_DSV         Texture1D;
    D3D11_TEX1D_ARRAY_DSV   Texture1DArray;
    D3D11_TEX2D_DSV         Texture2D;
    D3D11_TEX2D_ARRAY_DSV   Texture2DArray;
    D3D11_TEX2DMS_DSV       Texture2DMS;
    D3D11_TEX2DMS_ARRAY_DSV Texture2DMSArray;
  };
} D3D11_DEPTH_STENCIL_VIEW_DESC;

Members

Format

Type: DXGI_FORMAT

Resource data format (see DXGI_FORMAT). See remarks for allowable formats.

ViewDimension

Type: D3D11_DSV_DIMENSION

Type of resource (see D3D11_DSV_DIMENSION). Specifies how a depth-stencil resource will be accessed; the value is stored in the union in this structure.

Flags

Type: UINT

A value that describes whether the texture is read only. Pass 0 to specify that it is not read only; otherwise, pass one of the members of the D3D11_DSV_FLAG enumerated type.

Texture1D

Type: D3D11_TEX1D_DSV

Specifies a 1D texture subresource (see D3D11_TEX1D_DSV).

Texture1DArray

Type: D3D11_TEX1D_ARRAY_DSV

Specifies an array of 1D texture subresources (see D3D11_TEX1D_ARRAY_DSV).

Texture2D

Type: D3D11_TEX2D_DSV

Specifies a 2D texture subresource (see D3D11_TEX2D_DSV).

Texture2DArray

Type: D3D11_TEX2D_ARRAY_DSV

Specifies an array of 2D texture subresources (see D3D11_TEX2D_ARRAY_DSV).

Texture2DMS

Type: D3D11_TEX2DMS_DSV

Specifies a multisampled 2D texture (see D3D11_TEX2DMS_DSV).

Texture2DMSArray

Type: D3D11_TEX2DMS_ARRAY_DSV

Specifies an array of multisampled 2D textures (see D3D11_TEX2DMS_ARRAY_DSV).

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 cannot use a typeless format. If the format chosen is DXGI_FORMAT_UNKNOWN, then the format of the parent resource is used.

A depth-stencil-view description is needed when calling ID3D11Device::CreateDepthStencilView.

Requirements

Requirement Value
Header d3d11.h

See also

Resource Structures