GPUQueue
class GPUQueue : AutoCloseable
A queue for submitting command buffers to the GPU.
Summary
Public functions |
|
|---|---|
open external Unit |
close()Decrements the reference count of the object and frees resources when the count reaches zero. |
open operator Boolean |
|
open Int |
hashCode() |
suspend Unit |
Schedules a callback to be invoked when all previously submitted work is complete. |
external Unit |
@FastNativeSchedules a callback to be invoked when all previously submitted work is complete. |
external Unit |
@FastNativeSets a human-readable label for debugging. |
external Unit |
@FastNativeSubmits a list of command buffers to be executed. |
external Unit |
@FastNativeWrites data to a buffer from the CPU. |
external Unit |
@FastNativeWrites data to a texture from the CPU. |
Public functions
close
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.
onSubmittedWorkDone
suspend fun onSubmittedWorkDone(): Unit
Schedules a callback to be invoked when all previously submitted work is complete.
onSubmittedWorkDone
@FastNative
external fun onSubmittedWorkDone(
callbackExecutor: Executor,
callback: GPURequestCallback<Unit>
): Unit
Schedules a callback to be invoked when all previously submitted work is complete.
setLabel
@FastNative
external fun setLabel(label: String): Unit
Sets a human-readable label for debugging.
| Parameters | |
|---|---|
label: String |
The label string. |
submit
@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
@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
@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. |