---
title: "StencilFaceState: interface in Runtime, TypeShade API"
description: "StencilFaceState, an interface in Runtime. WebGPU GPUStencilFaceState: the stencil test and its three operations for one face."
url: https://typeshade.dev/api/stencilfacestate/
language: en
---

# `StencilFaceState`

Interface in Runtime

WebGPU GPUStencilFaceState: the stencil test and its three operations for one face.

`import type { StencilFaceState } from 'typeshade/runtime'`

The signature, the description and the examples come from the compiler's own source at commit af54ddad5.

## Syntax

```ts
interface StencilFaceState {
  readonly compare?: CompareFunction;
  readonly failOp?: StencilOperation;
  readonly depthFailOp?: StencilOperation;
  readonly passOp?: StencilOperation;
}
```

## Description

Each field it omits takes its default.

## Instance properties

**`compare` optional read only `CompareFunction`**

compare. How the test compares the reference with the stored value, each masked by `readMask`. Default `'always'`.

**`failOp` optional read only `StencilOperation`**

failOp. What a fragment that fails the stencil test does to the stored value. Default `'keep'`.

**`depthFailOp` optional read only `StencilOperation`**

depthFailOp. What a fragment that passes the stencil test and fails the depth test does. Default `'keep'`.

**`passOp` optional read only `StencilOperation`**

passOp. What a fragment that passes both tests does. Default `'keep'`.

## Source

[`src/runtime/program.ts`, line 123](https://github.com/typeshade/typeshade/blob/af54ddad5/src/runtime/program.ts#L123), at commit af54ddad5
