GPUQueue


public final class GPUQueue implements AutoCloseable


A queue for submitting command buffers to the GPU.

Summary

Public methods

external void

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

boolean
equals(Object other)
final long
int
final void

Schedules a callback to be invoked when all previously submitted work is complete.

final external void
@FastNative
onSubmittedWorkDone(
    @NonNull Executor callbackExecutor,
    @NonNull GPURequestCallback<Unit> callback
)

Schedules a callback to be invoked when all previously submitted work is complete.

final external void

Sets a human-readable label for debugging.

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

Submits a list of command buffers to be executed.

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

Writes data to a buffer from the CPU.

final external void
@FastNative
writeTexture(
    @NonNull GPUTexelCopyTextureInfo destination,
    @NonNull ByteBuffer data,
    @NonNull GPUExtent3D writeSize,
    @NonNull GPUTexelCopyBufferLayout dataLayout
)

Writes data to a texture from the CPU.

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.

equals

public boolean equals(Object other)

getHandle

Added in 1.0.0-alpha04
public final long getHandle()

hashCode

public int hashCode()

onSubmittedWorkDone

Added in 1.0.0-alpha04
public final void onSubmittedWorkDone()

Schedules a callback to be invoked when all previously submitted work is complete.

onSubmittedWorkDone

Added in 1.0.0-alpha04
@FastNative
public final external void onSubmittedWorkDone(
    @NonNull Executor callbackExecutor,
    @NonNull GPURequestCallback<Unit> callback
)

Schedules a callback to be invoked when all previously submitted work is complete.

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.

submit

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

Submits a list of command buffers to be executed.

Parameters
@NonNull GPUCommandBuffer[] commands

An array of command buffers to submit.

writeBuffer

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

Writes data to a buffer from the CPU.

Parameters
@NonNull GPUBuffer buffer

The destination buffer.

long bufferOffset

The offset in the destination buffer.

@NonNull ByteBuffer data

A pointer to the data to write.

writeTexture

Added in 1.0.0-alpha04
@FastNative
public final external void writeTexture(
    @NonNull GPUTexelCopyTextureInfo destination,
    @NonNull ByteBuffer data,
    @NonNull GPUExtent3D writeSize,
    @NonNull GPUTexelCopyBufferLayout dataLayout
)

Writes data to a texture from the CPU.

Parameters
@NonNull GPUTexelCopyTextureInfo destination

The destination texture information.

@NonNull ByteBuffer data

A pointer to the data to write.

@NonNull GPUExtent3D writeSize

The size of the region to write.

@NonNull GPUTexelCopyBufferLayout dataLayout

The layout of the data in the source buffer.