Aller au contenu

GPUQueue

interface GPUQueue : GPUObjectBase
Submits command buffers and schedules writes and copies for execution by the GPUDevice.

Properties

label

abstract var label: String
A developer-provided label which is used in an implementation-defined way. It can be used by the browser, OS, or other tools to help identify the underlying internal object to the developer. Examples include displaying the label in GPUError messages, console warnings, browser developer tools, and platform debugging utilities.

Functions

onSubmittedWorkDone

abstract suspend fun onSubmittedWorkDone(): Result<Unit>
Returns a Promise that resolves once this queue finishes processing all the work submitted up to this moment. Resolution of this Promise implies the completion of mapAsync() calls made prior to that call, on GPUBuffers last used exclusively on that queue.

submit

abstract fun submit(commandBuffers: List<GPUCommandBuffer>)
Schedules the execution of the command buffers by the GPU on this queue. Submitted command buffers cannot be used again.

writeBuffer

abstract fun writeBuffer(
    buffer: GPUBuffer, 
    bufferOffset: GPUSize64, 
    data: ArrayBuffer, 
    dataOffset: GPUSize64, 
    size: GPUSize64? = null
)
Issues a write operation of the provided data into a GPUBuffer. **Parameters** - buffer: The buffer to write to. - bufferOffset: Offset in bytes into buffer to begin writing at. - data: Data to write into buffer. - dataOffset: Offset in into data to begin writing from. Given in elements if data is a TypedArray and bytes otherwise. - size: Size of content to write from data to buffer. Given in elements if data is a TypedArray and bytes otherwise.

writeTexture

abstract fun writeTexture(
    destination: GPUTexelCopyTextureInfo, 
    data: ArrayBuffer, 
    dataLayout: GPUTexelCopyBufferLayout, 
    size: GPUExtent3D
)
Issues a write operation of the provided data into a GPUTexture. **Parameters** - destination: The texture subresource and origin to write to. - data: Data to write into destination. - dataLayout: Layout of the content in data. - size: Extents of the content to write from data to destination.