# CompareFunction

Artifact: [androidx.webgpu:webgpu](https://developer.android.com/jetpack/androidx/releases/webgpu) [View Source](https://cs.android.com/search?q=file:androidx/webgpu/CompareFunction.kt+class:androidx.webgpu.CompareFunction) Added in [1.0.0-alpha06](https://developer.android.com/jetpack/androidx/releases/webgpu#1.0.0-alpha06)

*** ** * ** ***


```
public final class CompareFunction
```

<br />

*** ** * ** ***

Defines the comparison function used for depth and stencil tests.

## Summary

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/webgpu/CompareFunction#Always() = 8` The comparison always passes. |
| `static final int` | `https://developer.android.com/reference/androidx/webgpu/CompareFunction#Equal() = 3` The comparison passes if the new value is equal to the existing value. |
| `static final int` | `https://developer.android.com/reference/androidx/webgpu/CompareFunction#Greater() = 5` The comparison passes if the new value is greater than the existing value. |
| `static final int` | `https://developer.android.com/reference/androidx/webgpu/CompareFunction#GreaterEqual() = 7` The comparison passes if the new value is greater than or equal to the existing value. |
| `static final int` | `https://developer.android.com/reference/androidx/webgpu/CompareFunction#Less() = 2` The comparison passes if the new value is less than the existing value. |
| `static final int` | `https://developer.android.com/reference/androidx/webgpu/CompareFunction#LessEqual() = 4` The comparison passes if the new value is less than or equal to the existing value. |
| `static final int` | `https://developer.android.com/reference/androidx/webgpu/CompareFunction#Never() = 1` The comparison never passes. |
| `static final int` | `https://developer.android.com/reference/androidx/webgpu/CompareFunction#NotEqual() = 6` The comparison passes if the new value is not equal to the existing value. |
| `static final int` | `https://developer.android.com/reference/androidx/webgpu/CompareFunction#Undefined() = 0` Indicates that no compare function is specified. |

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/webgpu/CompareFunction#toString(kotlin.Int)(int value)` |

## Constants

### Always

```
public static final int Always = 8
```

The comparison always passes.

### Equal

```
public static final int Equal = 3
```

The comparison passes if the new value is equal to the existing value.

### Greater

```
public static final int Greater = 5
```

The comparison passes if the new value is greater than the existing value.

### GreaterEqual

```
public static final int GreaterEqual = 7
```

The comparison passes if the new value is greater than or equal to the existing value.

### Less

```
public static final int Less = 2
```

The comparison passes if the new value is less than the existing value.

### LessEqual

```
public static final int LessEqual = 4
```

The comparison passes if the new value is less than or equal to the existing value.

### Never

```
public static final int Never = 1
```

The comparison never passes.

### NotEqual

```
public static final int NotEqual = 6
```

The comparison passes if the new value is not equal to the existing value.

### Undefined

```
public static final int Undefined = 0
```

Indicates that no compare function is specified.

## Public methods

### toString

Added in [1.0.0-alpha06](https://developer.android.com/jetpack/androidx/releases/webgpu#1.0.0-alpha06)

```
public static final @NonNull String toString(int value)
```