GPUHardwareBufferWrapper


@ExperimentalWebGpuApi
abstract class GPUHardwareBufferWrapper : AutoCloseable


Base abstract wrapper for imported hardware buffers. Manages the native handle and synchronization fences for accessing the buffer.

Summary

Public constructors

Public functions

Unit

Begins access to the hardware buffer, passing any wait fences to the native layer.

open Unit
GPUSyncFence?

Ends access to the hardware buffer, returning a signal fence from the native layer.

Protected functions

external Unit
nativeBeginAccess(handle: Long, fences: IntArray?)
external Unit
external Int

Public constructors

GPUHardwareBufferWrapper

Added in 1.0.0-alpha06
GPUHardwareBufferWrapper(handle: Long)

Public functions

beginAccess

Added in 1.0.0-alpha06
fun beginAccess(fences: Array<GPUSyncFence>?): Unit

Begins access to the hardware buffer, passing any wait fences to the native layer.

Parameters
fences: Array<GPUSyncFence>?

Array of GPUSyncFence objects to wait on before accessing the buffer.

close

Added in 1.0.0-alpha06
open fun close(): Unit

endAccess

Added in 1.0.0-alpha06
fun endAccess(): GPUSyncFence?

Ends access to the hardware buffer, returning a signal fence from the native layer.

Returns
GPUSyncFence?

GPUSyncFence that will be signaled when WebGPU is done with the buffer.

Protected functions

nativeBeginAccess

Added in 1.0.0-alpha06
protected external fun nativeBeginAccess(handle: Long, fences: IntArray?): Unit

nativeDestroy

Added in 1.0.0-alpha06
protected external fun nativeDestroy(handle: Long): Unit

nativeEndAccess

Added in 1.0.0-alpha06
protected external fun nativeEndAccess(handle: Long): Int