---
title: "CompareFunction: type in Runtime, TypeShade API reference"
description: "CompareFunction, a type in Runtime. WebGPU GPUCompareFunction: how a depth test compares a fragment with the stored value."
url: https://typeshade.dev/api/comparefunction/
language: en
---

# `CompareFunction`

Type in Runtime

WebGPU GPUCompareFunction: how a depth test compares a fragment with the stored value.

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

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

## Syntax

```ts
type CompareFunction = (typeof COMPARE_FUNCTIONS)[number];
```

## Source

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