# GPURenderPassEncoder

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

*** ** * ** ***


```
class GPURenderPassEncoder : AutoCloseable
```

<br />

*** ** * ** ***

An object used to record commands for a render pass.

## Summary

| ### Public functions |
|---|---|
| `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/GPURenderPassEncoder#beginOcclusionQuery(kotlin.Int)(queryIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Begins an occlusion query. |
| `open external https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/webgpu/GPURenderPassEncoder#close()()` Decrements the reference count of the object and frees resources when the count reaches zero. |
| `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/GPURenderPassEncoder#draw(kotlin.Int,kotlin.Int,kotlin.Int,kotlin.Int)( vertexCount: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, instanceCount: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, firstVertex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, firstInstance: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Draws non-indexed primitives. |
| `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/GPURenderPassEncoder#drawIndexed(kotlin.Int,kotlin.Int,kotlin.Int,kotlin.Int,kotlin.Int)( indexCount: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, instanceCount: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, firstIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, baseVertex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, firstInstance: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Draws indexed primitives. |
| `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/GPURenderPassEncoder#drawIndexedIndirect(androidx.webgpu.GPUBuffer,kotlin.Long)(indirectBuffer: https://developer.android.com/reference/kotlin/androidx/webgpu/GPUBuffer, indirectOffset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Draws indexed primitives with parameters from a buffer. |
| `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/GPURenderPassEncoder#drawIndirect(androidx.webgpu.GPUBuffer,kotlin.Long)(indirectBuffer: https://developer.android.com/reference/kotlin/androidx/webgpu/GPUBuffer, indirectOffset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Draws non-indexed primitives with parameters from a buffer. |
| `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/GPURenderPassEncoder#end()()` Ends the render pass. |
| `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/GPURenderPassEncoder#endOcclusionQuery()()` Ends an occlusion query. |
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/webgpu/GPURenderPassEncoder#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `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/GPURenderPassEncoder#executeBundles(kotlin.Array)(bundles: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/webgpu/GPURenderBundle>)` Executes a list of render bundles. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/webgpu/GPURenderPassEncoder#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/GPURenderPassEncoder#insertDebugMarker(kotlin.String)(markerLabel: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Inserts a debug marker into the command stream. |
| `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/GPURenderPassEncoder#popDebugGroup()()` Pops the current debug group. |
| `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/GPURenderPassEncoder#pushDebugGroup(kotlin.String)(groupLabel: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Pushes a new debug group. |
| `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/GPURenderPassEncoder#setBindGroup(kotlin.Int,androidx.webgpu.GPUBindGroup,kotlin.IntArray)( groupIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, group: https://developer.android.com/reference/kotlin/androidx/webgpu/GPUBindGroup?, dynamicOffsets: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html )` Sets a bind group for the pipeline. |
| `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/GPURenderPassEncoder#setBlendConstant(androidx.webgpu.GPUColor)(color: https://developer.android.com/reference/kotlin/androidx/webgpu/GPUColor)` Sets the blend constant color. |
| `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/GPURenderPassEncoder#setImmediates(kotlin.Int,java.nio.ByteBuffer)(offset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, data: https://developer.android.com/reference/java/nio/ByteBuffer.html)` |
| `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/GPURenderPassEncoder#setIndexBuffer(androidx.webgpu.GPUBuffer,kotlin.Int,kotlin.Long,kotlin.Long)(buffer: https://developer.android.com/reference/kotlin/androidx/webgpu/GPUBuffer, format: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, offset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, size: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Sets the index buffer. |
| `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/GPURenderPassEncoder#setLabel(kotlin.String)(label: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Sets a human-readable label for debugging. |
| `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/GPURenderPassEncoder#setPipeline(androidx.webgpu.GPURenderPipeline)(pipeline: https://developer.android.com/reference/kotlin/androidx/webgpu/GPURenderPipeline)` Sets the current render pipeline. |
| `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/GPURenderPassEncoder#setScissorRect(kotlin.Int,kotlin.Int,kotlin.Int,kotlin.Int)(x: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, y: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, width: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, height: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Sets the scissor rectangle. |
| `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/GPURenderPassEncoder#setStencilReference(kotlin.Int)(reference: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Sets the stencil reference value. |
| `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/GPURenderPassEncoder#setVertexBuffer(kotlin.Int,androidx.webgpu.GPUBuffer,kotlin.Long,kotlin.Long)(slot: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, buffer: https://developer.android.com/reference/kotlin/androidx/webgpu/GPUBuffer?, offset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, size: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Sets a vertex buffer for a specific slot. |
| `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/GPURenderPassEncoder#setViewport(kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)( x: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, y: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, width: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, height: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, minDepth: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, maxDepth: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html )` Sets the viewport rectangle. |

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

## Public functions

### beginOcclusionQuery

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

```
@FastNative
external fun beginOcclusionQuery(queryIndex: Int): Unit
```

Begins an occlusion query.

| Parameters |
|---|---|
| `queryIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The index of the query in the query set. |

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

### draw

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

```
@FastNative
external fun draw(
    vertexCount: Int,
    instanceCount: Int = 1,
    firstVertex: Int = 0,
    firstInstance: Int = 0
): Unit
```

Draws non-indexed primitives.

| Parameters |
|---|---|
| `vertexCount: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The number of vertices to draw. |
| `instanceCount: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = 1` | The number of instances to draw. |
| `firstVertex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = 0` | The index of the first vertex to draw. |
| `firstInstance: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = 0` | The index of the first instance to draw. |

### drawIndexed

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

```
@FastNative
external fun drawIndexed(
    indexCount: Int,
    instanceCount: Int = 1,
    firstIndex: Int = 0,
    baseVertex: Int = 0,
    firstInstance: Int = 0
): Unit
```

Draws indexed primitives.

| Parameters |
|---|---|
| `indexCount: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The number of indices to draw. |
| `instanceCount: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = 1` | The number of instances to draw. |
| `firstIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = 0` | The index of the first index to draw. |
| `baseVertex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = 0` | A value added to each index before reading from the vertex buffer. |
| `firstInstance: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = 0` | The index of the first instance to draw. |

### drawIndexedIndirect

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

```
@FastNative
external fun drawIndexedIndirect(indirectBuffer: GPUBuffer, indirectOffset: Long): Unit
```

Draws indexed primitives with parameters from a buffer.

| Parameters |
|---|---|
| `indirectBuffer: https://developer.android.com/reference/kotlin/androidx/webgpu/GPUBuffer` | The buffer containing the draw parameters. |
| `indirectOffset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The offset in the indirect buffer. |

### drawIndirect

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

```
@FastNative
external fun drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: Long): Unit
```

Draws non-indexed primitives with parameters from a buffer.

| Parameters |
|---|---|
| `indirectBuffer: https://developer.android.com/reference/kotlin/androidx/webgpu/GPUBuffer` | The buffer containing the draw parameters. |
| `indirectOffset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The offset in the indirect buffer. |

### end

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

```
@FastNative
external fun end(): Unit
```

Ends the render pass.

### endOcclusionQuery

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

```
@FastNative
external fun endOcclusionQuery(): Unit
```

Ends an occlusion query.

### equals

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

### executeBundles

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

```
@FastNative
external fun executeBundles(bundles: Array<GPURenderBundle> = arrayOf()): Unit
```

Executes a list of render bundles.

| Parameters |
|---|---|
| `bundles: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/webgpu/GPURenderBundle> = arrayOf()` | An array of render bundles to execute. |

### hashCode

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

### insertDebugMarker

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

```
@FastNative
external fun insertDebugMarker(markerLabel: String): Unit
```

Inserts a debug marker into the command stream.

| Parameters |
|---|---|
| `markerLabel: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The label for the debug marker. |

### popDebugGroup

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

```
@FastNative
external fun popDebugGroup(): Unit
```

Pops the current debug group.

### pushDebugGroup

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

```
@FastNative
external fun pushDebugGroup(groupLabel: String): Unit
```

Pushes a new debug group.

| Parameters |
|---|---|
| `groupLabel: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The label for the debug group. |

### setBindGroup

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

```
@FastNative
external fun setBindGroup(
    groupIndex: Int,
    group: GPUBindGroup? = null,
    dynamicOffsets: IntArray = intArrayOf()
): Unit
```

Sets a bind group for the pipeline.

| Parameters |
|---|---|
| `groupIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The index of the bind group. |
| `group: https://developer.android.com/reference/kotlin/androidx/webgpu/GPUBindGroup? = null` | The bind group to set. |
| `dynamicOffsets: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html = intArrayOf()` | An array of dynamic offsets. |

### setBlendConstant

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

```
@FastNative
external fun setBlendConstant(color: GPUColor): Unit
```

Sets the blend constant color.

| Parameters |
|---|---|
| `color: https://developer.android.com/reference/kotlin/androidx/webgpu/GPUColor` | The RGBA blend constant. |

### setImmediates

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

```
@FastNative
external fun setImmediates(offset: Int, data: ByteBuffer): Unit
```

### setIndexBuffer

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

```
@FastNative
external fun setIndexBuffer(
    buffer: GPUBuffer,
    format: Int = IndexFormat.Undefined,
    offset: Long = 0,
    size: Long = Constants.WHOLE_SIZE
): Unit
```

Sets the index buffer.

| Parameters |
|---|---|
| `buffer: https://developer.android.com/reference/kotlin/androidx/webgpu/GPUBuffer` | The index buffer. |
| `format: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = IndexFormat.Undefined` | The format of the indices. Value is one of the following: - `0` - `1` - `2` <br /> |
| `offset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html = 0` | The offset in the index buffer. |
| `size: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html = Constants.WHOLE_SIZE` | The size of the index data to use. |

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

### setPipeline

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

```
@FastNative
external fun setPipeline(pipeline: GPURenderPipeline): Unit
```

Sets the current render pipeline.

| Parameters |
|---|---|
| `pipeline: https://developer.android.com/reference/kotlin/androidx/webgpu/GPURenderPipeline` | The render pipeline to set. |

### setScissorRect

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

```
@FastNative
external fun setScissorRect(x: Int, y: Int, width: Int, height: Int): Unit
```

Sets the scissor rectangle.

| Parameters |
|---|---|
| `x: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The x-coordinate of the scissor rectangle. |
| `y: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The y-coordinate of the scissor rectangle. |
| `width: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The width of the scissor rectangle. |
| `height: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The height of the scissor rectangle. |

### setStencilReference

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

```
@FastNative
external fun setStencilReference(reference: Int): Unit
```

Sets the stencil reference value.

| Parameters |
|---|---|
| `reference: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The stencil reference value. |

### setVertexBuffer

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

```
@FastNative
external fun setVertexBuffer(
    slot: Int,
    buffer: GPUBuffer? = null,
    offset: Long = 0,
    size: Long = Constants.WHOLE_SIZE
): Unit
```

Sets a vertex buffer for a specific slot.

| Parameters |
|---|---|
| `slot: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The vertex buffer slot. |
| `buffer: https://developer.android.com/reference/kotlin/androidx/webgpu/GPUBuffer? = null` | The vertex buffer. |
| `offset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html = 0` | The offset in the vertex buffer. |
| `size: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html = Constants.WHOLE_SIZE` | The size of the vertex data to use. |

### setViewport

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

```
@FastNative
external fun setViewport(
    x: Float,
    y: Float,
    width: Float,
    height: Float,
    minDepth: Float,
    maxDepth: Float
): Unit
```

Sets the viewport rectangle.

| Parameters |
|---|---|
| `x: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | The x-coordinate of the viewport. |
| `y: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | The y-coordinate of the viewport. |
| `width: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | The width of the viewport. |
| `height: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | The height of the viewport. |
| `minDepth: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | The minimum depth of the viewport. |
| `maxDepth: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | The maximum depth of the viewport. |

## Public properties

### handle

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

```
val handle: Long
```