GPUQueue
public final class GPUQueue implements AutoCloseable
Used to submit recorded command buffers to the GPU for execution.
Summary
Public methods |
|
|---|---|
external void |
close() |
boolean |
|
final long |
|
int |
hashCode() |
final void |
Registers a callback to be invoked when all previously submitted work completes. |
final external void |
@FastNativeRegisters a callback to be invoked when all previously submitted work completes. |
final external void |
@FastNativeSets a debug label for the queue. |
final external void |
@FastNativeSubmits a list of command buffers for execution on the GPU. |
final external void |
@FastNativeSynchronously writes data from CPU memory to a GPU buffer. |
final external void |
@FastNativeSynchronously writes data from CPU memory to a GPU texture. |
Public methods
onSubmittedWorkDone
public final void onSubmittedWorkDone()
Registers a callback to be invoked when all previously submitted work completes.
onSubmittedWorkDone
@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
@FastNative
public final external void setLabel(@NonNull String label)
Sets a debug label for the queue.
submit
@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
@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
@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. |