GPUComputePassEncoder


public final class GPUComputePassEncoder implements AutoCloseable


An object used to record commands for a compute pass.

Summary

Public methods

external void

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

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

Dispatches a compute shader.

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

Dispatches a compute shader with parameters from a buffer.

final external void

Ends the compute pass.

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

Inserts a debug marker into the command stream.

final external void

Pops the current debug group.

final external void

Pushes a new debug group.

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

Sets a bind group for the pipeline.

final external void

Sets a human-readable label for debugging.

final external void

Sets the current compute pipeline.

Public methods

close

Added in 1.0.0-alpha04
public external void close()

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
public final external void dispatchWorkgroups(
    int workgroupCountX,
    int workgroupCountY,
    int workgroupCountZ
)

Dispatches a compute shader.

Parameters
int workgroupCountX

The number of workgroups in the X dimension.

int workgroupCountY

The number of workgroups in the Y dimension.

int workgroupCountZ

The number of workgroups in the Z dimension.

dispatchWorkgroupsIndirect

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

Dispatches a compute shader with parameters from a buffer.

Parameters
@NonNull GPUBuffer indirectBuffer

The buffer containing the dispatch parameters.

long indirectOffset

The offset in the indirect buffer.

end

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

Ends the compute pass.

equals

public boolean equals(Object other)

getHandle

Added in 1.0.0-alpha04
public final long getHandle()

hashCode

public int hashCode()

insertDebugMarker

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

Inserts a debug marker into the command stream.

Parameters
@NonNull String markerLabel

The label for the debug marker.

popDebugGroup

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

Pops the current debug group.

pushDebugGroup

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

Pushes a new debug group.

Parameters
@NonNull String groupLabel

The label for the debug group.

setBindGroup

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

Sets a bind group for the pipeline.

Parameters
int groupIndex

The index of the bind group.

GPUBindGroup group

The bind group to set.

@NonNull int[] dynamicOffsets

An array of dynamic offsets.

setLabel

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

Sets a human-readable label for debugging.

Parameters
@NonNull String label

The label string.

setPipeline

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

Sets the current compute pipeline.

Parameters
@NonNull GPUComputePipeline pipeline

The compute pipeline to set.