GPUComputePassEncoder


public final class GPUComputePassEncoder implements AutoCloseable


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

Summary

Public methods

external void
final external void
@FastNative
dispatchWorkgroups(
    int workgroupCountX,
    int workgroupCountY,
    int workgroupCountZ
)

Dispatches compute workgroups with explicitly defined counts.

final external void
@FastNative
dispatchWorkgroupsIndirect(
    @NonNull GPUBuffer indirectBuffer,
    long indirectOffset
)

Dispatches compute workgroups using arguments from a buffer.

final external void

Ends the compute pass.

boolean
equals(Object other)
final long
int
final external void

Inserts a debug marker command into the pass.

final external void

Ends the most recently pushed debug group.

final external void

Starts a new named debug group.

final external void
@FastNative
setBindGroup(
    int groupIndex,
    GPUBindGroup group,
    @NonNull int[] dynamicOffsets
)

Sets the bind group for a given index.

final external void

Sets a debug label for the compute pass encoder.

final external void

Sets the active compute pipeline.

Public methods

close

Added in 1.0.0-alpha01
public external void close()

dispatchWorkgroups

Added in 1.0.0-alpha01
@FastNative
public final external void dispatchWorkgroups(
    int workgroupCountX,
    int workgroupCountY,
    int workgroupCountZ
)

Dispatches compute workgroups with explicitly defined counts.

Parameters
int workgroupCountX

The number of workgroups to dispatch in the X dimension.

int workgroupCountY

The number of workgroups to dispatch in the Y dimension.

int workgroupCountZ

The number of workgroups to dispatch in the Z dimension.

dispatchWorkgroupsIndirect

Added in 1.0.0-alpha01
@FastNative
public final external void dispatchWorkgroupsIndirect(
    @NonNull GPUBuffer indirectBuffer,
    long indirectOffset
)

Dispatches compute workgroups using arguments from a buffer.

Parameters
@NonNull GPUBuffer indirectBuffer

The buffer containing the dispatch arguments.

long indirectOffset

The offset in the buffer where dispatch arguments start.

end

Added in 1.0.0-alpha01
@FastNative
public final external void end()

Ends the compute pass.

equals

public boolean equals(Object other)

getHandle

Added in 1.0.0-alpha01
public final long getHandle()

hashCode

public int hashCode()

insertDebugMarker

Added in 1.0.0-alpha01
@FastNative
public final external void insertDebugMarker(@NonNull String markerLabel)

Inserts a debug marker command into the pass.

Parameters
@NonNull String markerLabel

The label for the debug marker.

popDebugGroup

Added in 1.0.0-alpha01
@FastNative
public final external void popDebugGroup()

Ends the most recently pushed debug group.

pushDebugGroup

Added in 1.0.0-alpha01
@FastNative
public final external void pushDebugGroup(@NonNull String groupLabel)

Starts a new named debug group.

Parameters
@NonNull String groupLabel

The label for the debug group.

setBindGroup

Added in 1.0.0-alpha01
@FastNative
public final external void setBindGroup(
    int groupIndex,
    GPUBindGroup group,
    @NonNull int[] dynamicOffsets
)

Sets the bind group for a given index.

Parameters
int groupIndex

The index of the bind group to set.

GPUBindGroup group

The bind group object to set.

@NonNull int[] dynamicOffsets

An array of dynamic offsets for uniform/storage buffers.

setLabel

Added in 1.0.0-alpha01
@FastNative
public final external void setLabel(@NonNull String label)

Sets a debug label for the compute pass encoder.

Parameters
@NonNull String label

The label to assign to the compute pass encoder.

setPipeline

Added in 1.0.0-alpha01
@FastNative
public final external void setPipeline(@NonNull GPUComputePipeline pipeline)

Sets the active compute pipeline.

Parameters
@NonNull GPUComputePipeline pipeline

The compute pipeline to use for subsequent dispatch calls.