D3D11_DEPTH_STENCIL_VIEW_DESC structure

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;
  };
};

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.

__unnamed_union_0772_7

__unnamed_union_0772_7.Texture1D

__unnamed_union_0772_7.Texture1DArray

__unnamed_union_0772_7.Texture2D

__unnamed_union_0772_7.Texture2DArray

__unnamed_union_0772_7.Texture2DMS

__unnamed_union_0772_7.Texture2DMSArray

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

   
Header d3d11.h

See Also

Resource Structures