D3D11_DEPTH_STENCIL_DESC Structure

Describes depth-stencil state.

Syntax

typedef struct D3D11_DEPTH_STENCIL_DESC {
  BOOL                       DepthEnable;
  D3D11_DEPTH_WRITE_MASK     DepthWriteMask;
  D3D11_COMPARISON_FUNC      DepthFunc;
  BOOL                       StencilEnable;
  UINT8                      StencilReadMask;
  UINT8                      StencilWriteMask;
  D3D11_DEPTH_STENCILOP_DESC FrontFace;
  D3D11_DEPTH_STENCILOP_DESC BackFace;
} D3D11_DEPTH_STENCIL_DESC;

Mitglieder

  • DepthEnable
    Typ: BOOL

    Enable depth testing.

  • DepthWriteMask
    Typ: D3D11_DEPTH_WRITE_MASK

    Identify a portion of the depth-stencil buffer that can be modified by depth data (see D3D11_DEPTH_WRITE_MASK).

  • DepthFunc
    Typ: D3D11_COMPARISON_FUNC

    A function that compares depth data against existing depth data. The function options are listed in D3D11_COMPARISON_FUNC.

  • StencilEnable
    Typ: BOOL

    Enable stencil testing.

  • StencilReadMask
    Typ: UINT8

    Identify a portion of the depth-stencil buffer for reading stencil data.

  • StencilWriteMask
    Typ: UINT8

    Identify a portion of the depth-stencil buffer for writing stencil data.

  • FrontFace
    Typ: D3D11_DEPTH_STENCILOP_DESC

    Identify how to use the results of the depth test and the stencil test for pixels whose surface normal is facing towards the camera (see D3D11_DEPTH_STENCILOP_DESC).

  • BackFace
    Typ: D3D11_DEPTH_STENCILOP_DESC

    Identify how to use the results of the depth test and the stencil test for pixels whose surface normal is facing away from the camera (see D3D11_DEPTH_STENCILOP_DESC).

Hinweise

Depth-stencil state controls how depth-stencil testing is performed by the output-merger stage.

The following table shows the default values of depth-stencil states.

State Default Value
DepthEnable TRUE
DepthWriteMask D3D11_DEPTH_WRITE_MASK_ALL
DepthFunc D3D11_COMPARISON_LESS
StencilEnable FALSE
StencilReadMask D3D11_DEFAULT_STENCIL_READ_MASK
StencilWriteMask D3D11_DEFAULT_STENCIL_WRITE_MASK
StencilFunc D3D11_COMPARISON_ALWAYS
StencilDepthFailOp D3D11_STENCIL_OP_KEEP
StencilPassOp D3D11_STENCIL_OP_KEEP
StencilFailOp D3D11_STENCIL_OP_KEEP

 

The formats that support stenciling are DXGI_FORMAT_D24_UNORM_S8_UINT and DXGI_FORMAT_D32_FLOAT_S8X24_UINT.

Anforderungen

Header

D3D11.h

Siehe auch

Core Structures