D3D12_DEPTH_STENCIL_VIEW_DESC structure

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

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.

__unnamed_union_0782_7

__unnamed_union_0782_7.Texture1D

__unnamed_union_0782_7.Texture1DArray

__unnamed_union_0782_7.Texture2D

__unnamed_union_0782_7.Texture2DArray

__unnamed_union_0782_7.Texture2DMS

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

   
Header d3d12.h

See Also

Core Structures