GPUQueue


class GPUQueue : AutoCloseable


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

Summary

Public functions

open external Unit
open operator Boolean
equals(other: Any?)
open Int
suspend Unit

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

external Unit
@FastNative
onSubmittedWorkDone(
    callbackExecutor: Executor,
    callback: QueueWorkDoneCallback
)

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

external Unit

Sets a debug label for the queue.

external Unit

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

external Unit
@FastNative
writeBuffer(buffer: GPUBuffer, bufferOffset: Long, data: ByteBuffer)

Synchronously writes data from CPU memory to a GPU buffer.

external Unit
@FastNative
writeTexture(
    destination: TexelCopyTextureInfo,
    data: ByteBuffer,
    writeSize: Extent3D,
    dataLayout: TexelCopyBufferLayout
)

Synchronously writes data from CPU memory to a GPU texture.

Public properties

Long

Public functions

close

Added in 1.0.0-alpha01
open external fun close(): Unit

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

onSubmittedWorkDone

Added in 1.0.0-alpha01
suspend fun onSubmittedWorkDone(): Unit

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

onSubmittedWorkDone

Added in 1.0.0-alpha01
@FastNative
external fun onSubmittedWorkDone(
    callbackExecutor: Executor,
    callback: QueueWorkDoneCallback
): Unit

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

setLabel

Added in 1.0.0-alpha01
@FastNative
external fun setLabel(label: String): Unit

Sets a debug label for the queue.

Parameters
label: String

The label to assign to the queue.

submit

Added in 1.0.0-alpha01
@FastNative
external fun submit(commands: Array<GPUCommandBuffer> = arrayOf()): Unit

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

Parameters
commands: Array<GPUCommandBuffer> = arrayOf()

An array of command buffers to submit.

writeBuffer

Added in 1.0.0-alpha01
@FastNative
external fun writeBuffer(buffer: GPUBuffer, bufferOffset: Long, data: ByteBuffer): Unit

Synchronously writes data from CPU memory to a GPU buffer.

Parameters
buffer: GPUBuffer

The destination buffer.

bufferOffset: Long

The offset in the buffer to start writing.

data: ByteBuffer

A pointer to the source CPU data.

writeTexture

Added in 1.0.0-alpha01
@FastNative
external fun writeTexture(
    destination: TexelCopyTextureInfo,
    data: ByteBuffer,
    writeSize: Extent3D,
    dataLayout: TexelCopyBufferLayout = TexelCopyBufferLayout()
): Unit

Synchronously writes data from CPU memory to a GPU texture.

Parameters
destination: TexelCopyTextureInfo

Information about the destination texture and coordinates.

data: ByteBuffer

A pointer to the source CPU data.

writeSize: Extent3D

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

dataLayout: TexelCopyBufferLayout = TexelCopyBufferLayout()

The layout of the data in CPU memory.

Public properties

handle

Added in 1.0.0-alpha01
val handleLong