GPUQueue


public final class GPUQueue implements AutoCloseable


Used to submit recorded command buffers to the GPU for execution.

Summary

Public methods

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

Registers a callback to be invoked when all previously submitted work completes.

final external void
@FastNative
onSubmittedWorkDone(
    @NonNull Executor callbackExecutor,
    @NonNull QueueWorkDoneCallback callback
)

Registers a callback to be invoked when all previously submitted work completes.

final external void

Sets a debug label for the queue.

final external void
@FastNative
submit(@NonNull GPUCommandBuffer[] commands)

Submits a list of command buffers for execution on the GPU.

final external void
@FastNative
writeBuffer(
    @NonNull GPUBuffer buffer,
    long bufferOffset,
    @NonNull ByteBuffer data
)

Synchronously writes data from CPU memory to a GPU buffer.

final external void
@FastNative
writeTexture(
    @NonNull TexelCopyTextureInfo destination,
    @NonNull ByteBuffer data,
    @NonNull Extent3D writeSize,
    @NonNull TexelCopyBufferLayout dataLayout
)

Synchronously writes data from CPU memory to a GPU texture.

Public methods

close

Added in 1.0.0-alpha01
public external void close()

equals

public boolean equals(Object other)

getHandle

Added in 1.0.0-alpha01
public final long getHandle()

hashCode

public int hashCode()

onSubmittedWorkDone

Added in 1.0.0-alpha01
public final void onSubmittedWorkDone()

Registers a callback to be invoked when all previously submitted work completes.

onSubmittedWorkDone

Added in 1.0.0-alpha01
@FastNative
public final external void onSubmittedWorkDone(
    @NonNull Executor callbackExecutor,
    @NonNull QueueWorkDoneCallback callback
)

Registers a callback to be invoked when all previously submitted work completes.

setLabel

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

Sets a debug label for the queue.

Parameters
@NonNull String label

The label to assign to the queue.

submit

Added in 1.0.0-alpha01
@FastNative
public final external void submit(@NonNull GPUCommandBuffer[] commands)

Submits a list of command buffers for execution on the GPU.

Parameters
@NonNull GPUCommandBuffer[] commands

An array of command buffers to submit.

writeBuffer

Added in 1.0.0-alpha01
@FastNative
public final external void writeBuffer(
    @NonNull GPUBuffer buffer,
    long bufferOffset,
    @NonNull ByteBuffer data
)

Synchronously writes data from CPU memory to a GPU buffer.

Parameters
@NonNull GPUBuffer buffer

The destination buffer.

long bufferOffset

The offset in the buffer to start writing.

@NonNull ByteBuffer data

A pointer to the source CPU data.

writeTexture

Added in 1.0.0-alpha01
@FastNative
public final external void writeTexture(
    @NonNull TexelCopyTextureInfo destination,
    @NonNull ByteBuffer data,
    @NonNull Extent3D writeSize,
    @NonNull TexelCopyBufferLayout dataLayout
)

Synchronously writes data from CPU memory to a GPU texture.

Parameters
@NonNull TexelCopyTextureInfo destination

Information about the destination texture and coordinates.

@NonNull ByteBuffer data

A pointer to the source CPU data.

@NonNull Extent3D writeSize

The size (width, height, depth/layers) of the region to write.

@NonNull TexelCopyBufferLayout dataLayout

The layout of the data in CPU memory.