# GPUSampler

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

*** ** * ** ***


```
class GPUSampler : AutoCloseable
```

<br />

*** ** * ** ***

An object that controls how textures are sampled in a shader.

## Summary

| ### Public functions |
|---|---|
| `open external https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/webgpu/GPUSampler#close()()` Decrements the reference count of the object and frees resources when the count reaches zero. |
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/webgpu/GPUSampler#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/webgpu/GPUSampler#hashCode()()` |
| `external https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/dalvik/annotation/optimization/FastNative.html https://developer.android.com/reference/kotlin/androidx/webgpu/GPUSampler#setLabel(kotlin.String)(label: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Sets a human-readable label for debugging. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/webgpu/GPUSampler#handle()` |

## Public functions

### close

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

```
open external fun close(): Unit
```

Decrements the reference count of the object and frees resources when the count reaches zero.

This is the standard way to manage object lifetimes and should be used in `use` blocks. After calling this, the object is no longer usable.

### equals

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

```
open fun hashCode(): Int
```

### setLabel

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

```
@FastNative
external fun setLabel(label: String): Unit
```

Sets a human-readable label for debugging.

| Parameters |
|---|---|
| `label: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The label string. |

## Public properties

### handle

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

```
val handle: Long
```