> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# D3D12_DEPTH_STENCIL_DESC1

> Descreve o estado de profundidade/estêncil. (D3D12_DEPTH_STENCIL_DESC1)

Descreve o estado de profundidade/estêncil.

## Sintaxe

```cpp theme={null}
typedef struct D3D12_DEPTH_STENCIL_DESC1
{
    BOOL DepthEnable;
    D3D12_DEPTH_WRITE_MASK DepthWriteMask;
    D3D12_COMPARISON_FUNC DepthFunc;
    BOOL StencilEnable;
    UINT8 StencilReadMask;
    UINT8 StencilWriteMask;
    D3D12_DEPTH_STENCILOP_DESC FrontFace;
    D3D12_DEPTH_STENCILOP_DESC BackFace;
    BOOL DepthBoundsTestEnable;
} D3D12_DEPTH_STENCIL_DESC1
```

### Membros

*DepthEnable*\
Tipo: BOOL

Especifica se o teste de profundidade deve ser habilitado. Defina esse membro como **TRUE** para habilitar o teste de profundidade.

*DepthWriteMask*\
Tipo: D3D12\_DEPTH\_WRITE\_MASK

Um valor do tipo [D3D12\_DEPTH\_WRITE\_MASK](/pt-BR/reference/graphics/d3d12/enums/d3d12_depth_write_mask_public) que identifica uma parte do buffer de profundidade/estêncil que pode ser modificada por dados de profundidade.

*DepthFunc*\
Tipo: D3D12\_COMPARISON\_FUNC

Um valor do tipo [D3D12\_COMPARISON\_FUNC](/pt-BR/reference/graphics/d3d12/enums/d3d12_comparison_func_public) que identifica uma função que compara dados de profundidade com dados de profundidade existentes.

*StencilEnable*\
Tipo: BOOL

Especifica se o teste de estêncil deve ser habilitado. Defina esse membro como **TRUE** para habilitar o teste de estêncil.

*StencilReadMask*\
Tipo: UINT8

Identifica uma parte do buffer de profundidade/estêncil para leitura de dados de estêncil.

*StencilWriteMask*\
Tipo: UINT8

Identifica uma parte do buffer de profundidade/estêncil para gravação de dados de estêncil.

*FrontFace*\
Tipo: D3D12\_DEPTH\_STENCILOP\_DESC

Uma estrutura [D3D12\_DEPTH\_STENCILOP\_DESC](/pt-BR/reference/graphics/d3d12/structs/d3d12_depth_stencilop_desc_public) que descreve como usar os resultados do teste de profundidade e do teste de estêncil para pixels cuja normal da superfície está voltada para a câmera.

*BackFace*\
Tipo: D3D12\_DEPTH\_STENCILOP\_DESC

Uma estrutura [D3D12\_DEPTH\_STENCILOP\_DESC](/pt-BR/reference/graphics/d3d12/structs/d3d12_depth_stencilop_desc_public) que descreve como usar os resultados do teste de profundidade e do teste de estêncil para pixels cuja normal da superfície está voltada para o lado oposto da câmera.

*DepthBoundsTestEnable*\
Tipo: BOOL

TRUE para habilitar o teste de limites de profundidade; caso contrário, FALSE. O valor padrão é FALSE.

## Comentários

Um objeto [D3D12\_GRAPHICS\_PIPELINE\_STATE\_DESC](/pt-BR/reference/graphics/d3d12_x/structs/d3d12_graphics_pipeline_state_desc) contém uma estrutura de estado de profundidade/estêncil que controla como o teste de profundidade/estêncil é realizado pelo estágio de fusão de saída.

Esta tabela mostra os valores padrão dos estados de profundidade/estêncil.

<table>
  <tr>
    <th>Estado</th>
    <th>Valor padrão</th>
  </tr>

  <tr>
    <td>DepthEnable</td>
    <td>TRUE</td>
  </tr>

  <tr>
    <td>DepthWriteMask</td>
    <td>D3D12\_DEPTH\_WRITE\_MASK\_ALL</td>
  </tr>

  <tr>
    <td>DepthFunc</td>
    <td>D3D12\_COMPARISON\_LESS</td>
  </tr>

  <tr>
    <td>StencilEnable</td>
    <td>FALSE</td>
  </tr>

  <tr>
    <td>StencilReadMask</td>
    <td>D3D12\_DEFAULT\_STENCIL\_READ\_MASK</td>
  </tr>

  <tr>
    <td>StencilWriteMask</td>
    <td>D3D12\_DEFAULT\_STENCIL\_WRITE\_MASK</td>
  </tr>

  <tr>
    <td>
      FrontFace.StencilFunc

      e

      BackFace.StencilFunc
    </td>

    <td>D3D12\_COMPARISON\_ALWAYS</td>
  </tr>

  <tr>
    <td>
      FrontFace.StencilDepthFailOp

      e

      BackFace.StencilDepthFailOp
    </td>

    <td>D3D12\_STENCIL\_OP\_KEEP</td>
  </tr>

  <tr>
    <td>
      FrontFace.StencilPassOp

      e

      BackFace.StencilPassOp
    </td>

    <td>D3D12\_STENCIL\_OP\_KEEP</td>
  </tr>

  <tr>
    <td>
      FrontFace.StencilFailOp

      e

      BackFace.StencilFailOp
    </td>

    <td>D3D12\_STENCIL\_OP\_KEEP</td>
  </tr>

  <tr>
    <td>DepthBoundsTestEnable</td>
    <td>FALSE</td>
  </tr>
</table>

Os formatos que dão suporte a estêncil são DXGI\_FORMAT\_D24\_UNORM\_S8\_UINT e DXGI\_FORMAT\_D32\_FLOAT\_S8X24\_UINT.

## Requisitos

**Cabeçalho:** d3d12\_xs.h ou d3d12\_x.h\
**Biblioteca:** d3d12\_xs.lib ou d3d12\_x.lib\
**Plataformas com suporte**: consoles XBOX Series e família XBOX One

## Confira também

[Estruturas principais](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/direct3d-12-structures)


## Related topics

- [D3D12_PIPELINE_STATE_STREAM_DESC](/pt-BR/reference/graphics/d3d12/structs/d3d12_pipeline_state_stream_desc_public.md)
- [D3D12_RESOURCE_DESC1](/pt-BR/reference/graphics/d3d12/structs/d3d12_resource_desc1_public.md)
- [D3D12_ROOT_SIGNATURE_DESC1](/pt-BR/reference/graphics/d3d12/structs/d3d12_root_signature_desc1_public.md)
- [D3D12_DEPTH_STENCIL_DESC](/pt-BR/reference/graphics/d3d12/structs/d3d12_depth_stencil_desc_public.md)
- [D3D12_PROTECTED_RESOURCE_SESSION_DESC1](/pt-BR/reference/graphics/d3d12/structs/d3d12_protected_resource_session_desc1_public.md)
