GPUComputePassEncoder


class GPUComputePassEncoder : AutoCloseable


An object used to record commands for a compute pass.

Summary

Public functions

open external Unit

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

external Unit
@FastNative
dispatchWorkgroups(
    workgroupCountX: Int,
    workgroupCountY: Int,
    workgroupCountZ: Int
)

Dispatches a compute shader.

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

Dispatches a compute shader with parameters from a buffer.

external Unit

Ends the compute pass.

open operator Boolean
equals(other: Any?)
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

Sets a human-readable label for debugging.

external Unit

Sets the current compute pipeline.

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.

dispatchWorkgroups

Added in 1.0.0-alpha04
@FastNative
external fun dispatchWorkgroups(
    workgroupCountX: Int,
    workgroupCountY: Int = 1,
    workgroupCountZ: Int = 1
): Unit

Dispatches a compute shader.

Parameters
workgroupCountX: Int

The number of workgroups in the X dimension.

workgroupCountY: Int = 1

The number of workgroups in the Y dimension.

workgroupCountZ: Int = 1

The number of workgroups in the Z dimension.

dispatchWorkgroupsIndirect

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

Dispatches a compute shader with parameters from a buffer.

Parameters
indirectBuffer: GPUBuffer

The buffer containing the dispatch parameters.

indirectOffset: Long

The offset in the indirect buffer.

end

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

Ends the compute pass.

equals

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

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.

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: GPUComputePipeline): Unit

Sets the current compute pipeline.

Parameters
pipeline: GPUComputePipeline

The compute pipeline to set.

Public properties

handle

Added in 1.0.0-alpha04
val handleLong