# GPUShaderModule

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

*** ** * ** ***


```
class GPUShaderModule : AutoCloseable
```

<br />

*** ** * ** ***

A compiled shader module.

## Summary

| ### Public functions |
|---|---|
| `open external https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/webgpu/GPUShaderModule#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/GPUShaderModule#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `suspend https://developer.android.com/reference/kotlin/androidx/webgpu/GPUCompilationInfo` | `https://developer.android.com/reference/kotlin/androidx/webgpu/GPUShaderModule#getCompilationInfo()()` Asynchronously retrieves compilation information for the shader module. |
| `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/GPUShaderModule#getCompilationInfo(java.util.concurrent.Executor,androidx.webgpu.GPURequestCallback)( callbackExecutor: https://developer.android.com/reference/java/util/concurrent/Executor.html, callback: https://developer.android.com/reference/kotlin/androidx/webgpu/GPURequestCallback<https://developer.android.com/reference/kotlin/androidx/webgpu/GPUCompilationInfo> )` Asynchronously retrieves compilation information for the shader module. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/webgpu/GPUShaderModule#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/GPUShaderModule#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/GPUShaderModule#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
```

### getCompilationInfo

```
suspend fun getCompilationInfo(): GPUCompilationInfo
```

Asynchronously retrieves compilation information for the shader module.

### getCompilationInfo

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

```
@FastNative
external fun getCompilationInfo(
    callbackExecutor: Executor,
    callback: GPURequestCallback<GPUCompilationInfo>
): Unit
```

Asynchronously retrieves compilation information for the shader module.

### 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
```