GPUComputePassEncoder


class GPUComputePassEncoder : AutoCloseable


Used to record compute pipeline dispatch commands within a command encoder.

Summary

Public functions

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

Dispatches compute workgroups with explicitly defined counts.

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

Dispatches compute workgroups using arguments from a buffer.

external Unit

Ends the compute pass.

open operator Boolean
equals(other: Any?)
open Int
external Unit

Inserts a debug marker command into the pass.

external Unit

Ends the most recently pushed debug group.

external Unit

Starts a new named debug group.

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

Sets the bind group for a given index.

external Unit

Sets a debug label for the compute pass encoder.

external Unit

Sets the active compute pipeline.

Public properties

Long

Public functions

close

Added in 1.0.0-alpha01
open external fun close(): Unit

dispatchWorkgroups

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

Dispatches compute workgroups with explicitly defined counts.

Parameters
workgroupCountX: Int

The number of workgroups to dispatch in the X dimension.

workgroupCountY: Int = 1

The number of workgroups to dispatch in the Y dimension.

workgroupCountZ: Int = 1

The number of workgroups to dispatch in the Z dimension.

dispatchWorkgroupsIndirect

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

Dispatches compute workgroups using arguments from a buffer.

Parameters
indirectBuffer: GPUBuffer

The buffer containing the dispatch arguments.

indirectOffset: Long

The offset in the buffer where dispatch arguments start.

end

Added in 1.0.0-alpha01
@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-alpha01
@FastNative
external fun insertDebugMarker(markerLabel: String): Unit

Inserts a debug marker command into the pass.

Parameters
markerLabel: String

The label for the debug marker.

popDebugGroup

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

Ends the most recently pushed debug group.

pushDebugGroup

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

Starts a new named debug group.

Parameters
groupLabel: String

The label for the debug group.

setBindGroup

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

Sets the bind group for a given index.

Parameters
groupIndex: Int

The index of the bind group to set.

group: GPUBindGroup? = null

The bind group object to set.

dynamicOffsets: IntArray = intArrayOf()

An array of dynamic offsets for uniform/storage buffers.

setLabel

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

Sets a debug label for the compute pass encoder.

Parameters
label: String

The label to assign to the compute pass encoder.

setPipeline

Added in 1.0.0-alpha01
@FastNative
external fun setPipeline(pipeline: GPUComputePipeline): Unit

Sets the active compute pipeline.

Parameters
pipeline: GPUComputePipeline

The compute pipeline to use for subsequent dispatch calls.

Public properties

handle

Added in 1.0.0-alpha01
val handleLong