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

Members

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

ViewDimension
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
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
Specifies a 1D texture subresource (see D3D11_TEX1D_DSV).

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

Texture2D
Specifies a 2D texture subresource (see D3D11_TEX2D_DSV).

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

Texture2DMS
Specifies a multisampled 2D texture (see D3D11_TEX2DMS_DSV).

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

Remarks

These are valid formats for a depth-stencil view:

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: Declared in d3d11_x.h (d3d11.h on other Windows platforms).