GPURenderBundleEncoder


class GPURenderBundleEncoder : AutoCloseable


An object used to record commands for a render bundle.

Summary

Public functions

open external Unit

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

external Unit
@FastNative
draw(
    vertexCount: Int,
    instanceCount: Int,
    firstVertex: Int,
    firstInstance: Int
)

Draws non-indexed primitives.

external Unit
@FastNative
drawIndexed(
    indexCount: Int,
    instanceCount: Int,
    firstIndex: Int,
    baseVertex: Int,
    firstInstance: Int
)

Draws indexed primitives.

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

Draws indexed primitives with parameters from a buffer.

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

Draws non-indexed primitives with parameters from a buffer.

open operator Boolean
equals(other: Any?)
external GPURenderBundle

Finishes recording commands and creates a render bundle.

open Int
external Unit

Inserts a debug marker into the command stream.

external Unit

Pops the current debug group.

external Unit

Pushes a new debug group.

external Unit
@FastNative
setBindGroup(
    groupIndex: Int,
    group: GPUBindGroup?,
    dynamicOffsets: IntArray
)

Sets a bind group for the pipeline.

external Unit
@FastNative
setIndexBuffer(buffer: GPUBuffer, format: Int, offset: Long, size: Long)

Sets the index buffer.

external Unit

Sets a human-readable label for debugging.

external Unit

Sets the current render pipeline.

external Unit
@FastNative
setVertexBuffer(slot: Int, buffer: GPUBuffer?, offset: Long, size: Long)

Sets a vertex buffer for a specific slot.

Public properties

Long

Public functions

close

Added in 1.0.0-alpha04
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-alpha04
@FastNative
external fun draw(
    vertexCount: Int,
    instanceCount: Int = 1,
    firstVertex: Int = 0,
    firstInstance: Int = 0
): Unit

Draws non-indexed primitives.

Parameters
vertexCount: Int

The number of vertices to draw.

instanceCount: Int = 1

The number of instances to draw.

firstVertex: Int = 0

The index of the first vertex to draw.

firstInstance: Int = 0

The index of the first instance to draw.

drawIndexed

Added in 1.0.0-alpha04
@FastNative
external fun drawIndexed(
    indexCount: Int,
    instanceCount: Int = 1,
    firstIndex: Int = 0,
    baseVertex: Int = 0,
    firstInstance: Int = 0
): Unit

Draws indexed primitives.

Parameters
indexCount: Int

The number of indices to draw.

instanceCount: Int = 1

The number of instances to draw.

firstIndex: Int = 0

The index of the first index to draw.

baseVertex: Int = 0

A value added to each index before reading from the vertex buffer.

firstInstance: Int = 0

The index of the first instance to draw.

drawIndexedIndirect

Added in 1.0.0-alpha04
@FastNative
external fun drawIndexedIndirect(indirectBuffer: GPUBuffer, indirectOffset: Long): Unit

Draws indexed primitives with parameters from a buffer.

Parameters
indirectBuffer: GPUBuffer

The buffer containing the draw parameters.

indirectOffset: Long

The offset in the indirect buffer.

drawIndirect

Added in 1.0.0-alpha04
@FastNative
external fun drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: Long): Unit

Draws non-indexed primitives with parameters from a buffer.

Parameters
indirectBuffer: GPUBuffer

The buffer containing the draw parameters.

indirectOffset: Long

The offset in the indirect buffer.

equals

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

finish

Added in 1.0.0-alpha04
@FastNative
external fun finish(descriptor: GPURenderBundleDescriptor? = null): GPURenderBundle

Finishes recording commands and creates a render bundle.

Parameters
descriptor: GPURenderBundleDescriptor? = null

The descriptor for the render bundle.

Returns
GPURenderBundle

The created render bundle.

hashCode

open fun hashCode(): Int

insertDebugMarker

Added in 1.0.0-alpha04
@FastNative
external fun insertDebugMarker(markerLabel: String): Unit

Inserts a debug marker into the command stream.

Parameters
markerLabel: String

The label for the debug marker.

popDebugGroup

Added in 1.0.0-alpha04
@FastNative
external fun popDebugGroup(): Unit

Pops the current debug group.

pushDebugGroup

Added in 1.0.0-alpha04
@FastNative
external fun pushDebugGroup(groupLabel: String): Unit

Pushes a new debug group.

Parameters
groupLabel: String

The label for the debug group.

setBindGroup

Added in 1.0.0-alpha04
@FastNative
external fun setBindGroup(
    groupIndex: Int,
    group: GPUBindGroup? = null,
    dynamicOffsets: IntArray = intArrayOf()
): Unit

Sets a bind group for the pipeline.

Parameters
groupIndex: Int

The index of the bind group.

group: GPUBindGroup? = null

The bind group to set.

dynamicOffsets: IntArray = intArrayOf()

An array of dynamic offsets.

setIndexBuffer

Added in 1.0.0-alpha04
@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: GPUBuffer

The index buffer.

format: Int = IndexFormat.Undefined

The format of the indices.

offset: Long = 0

The offset in the index buffer.

size: Long = Constants.WHOLE_SIZE

The size of the index data to use.

setLabel

Added in 1.0.0-alpha04
@FastNative
external fun setLabel(label: String): Unit

Sets a human-readable label for debugging.

Parameters
label: String

The label string.

setPipeline

Added in 1.0.0-alpha04
@FastNative
external fun setPipeline(pipeline: GPURenderPipeline): Unit

Sets the current render pipeline.

Parameters
pipeline: GPURenderPipeline

The render pipeline to set.

setVertexBuffer

Added in 1.0.0-alpha04
@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: Int

The vertex buffer slot.

buffer: GPUBuffer? = null

The vertex buffer.

offset: Long = 0

The offset in the vertex buffer.

size: Long = Constants.WHOLE_SIZE

The size of the vertex data to use.

Public properties

handle

Added in 1.0.0-alpha04
val handleLong