GPUQueue


class GPUQueue : AutoCloseable


A queue for submitting command buffers to the GPU.

Summary

Public functions

open external Unit

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

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

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

external Unit
@FastNative
onSubmittedWorkDone(
    callbackExecutor: Executor,
    callback: GPURequestCallback<Unit>
)

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

external Unit

Sets a human-readable label for debugging.

external Unit

Submits a list of command buffers to be executed.

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

Writes data to a buffer from the CPU.

external Unit
@FastNative
writeTexture(
    destination: GPUTexelCopyTextureInfo,
    data: ByteBuffer,
    writeSize: GPUExtent3D,
    dataLayout: GPUTexelCopyBufferLayout
)

Writes data to a texture from the CPU.

Public properties

Long

Public functions

close

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

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

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

hashCode

open fun hashCode(): Int

onSubmittedWorkDone

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

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

onSubmittedWorkDone

Added in 1.0.0-alpha04
@FastNative
external fun onSubmittedWorkDone(
    callbackExecutor: Executor,
    callback: GPURequestCallback<Unit>
): Unit

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

setLabel

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

Sets a human-readable label for debugging.

Parameters
label: String

The label string.

submit

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

Submits a list of command buffers to be executed.

Parameters
commands: Array<GPUCommandBuffer> = arrayOf()

An array of command buffers to submit.

writeBuffer

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

Writes data to a buffer from the CPU.

Parameters
buffer: GPUBuffer

The destination buffer.

bufferOffset: Long

The offset in the destination buffer.

data: ByteBuffer

A pointer to the data to write.

writeTexture

Added in 1.0.0-alpha04
@FastNative
external fun writeTexture(
    destination: GPUTexelCopyTextureInfo,
    data: ByteBuffer,
    writeSize: GPUExtent3D,
    dataLayout: GPUTexelCopyBufferLayout = GPUTexelCopyBufferLayout()
): Unit

Writes data to a texture from the CPU.

Parameters
destination: GPUTexelCopyTextureInfo

The destination texture information.

data: ByteBuffer

A pointer to the data to write.

writeSize: GPUExtent3D

The size of the region to write.

dataLayout: GPUTexelCopyBufferLayout = GPUTexelCopyBufferLayout()

The layout of the data in the source buffer.

Public properties

handle

Added in 1.0.0-alpha04
val handleLong