GPUHardwareBufferWrapper


@ExperimentalWebGpuApi
public abstract class GPUHardwareBufferWrapper implements AutoCloseable


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

Summary

Public constructors

Public methods

final void
beginAccess(GPUSyncFence[] fences)

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

void
final GPUSyncFence

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

Protected methods

final external void
nativeBeginAccess(long handle, int[] fences)
final external void
nativeDestroy(long handle)
final external int
nativeEndAccess(long handle)

Public constructors

GPUHardwareBufferWrapper

Added in 1.0.0-alpha06
public GPUHardwareBufferWrapper(long handle)

Public methods

beginAccess

Added in 1.0.0-alpha06
public final void beginAccess(GPUSyncFence[] fences)

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

Parameters
GPUSyncFence[] fences

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

close

Added in 1.0.0-alpha06
public void close()

endAccess

Added in 1.0.0-alpha06
public final GPUSyncFence endAccess()

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 methods

nativeBeginAccess

Added in 1.0.0-alpha06
protected final external void nativeBeginAccess(long handle, int[] fences)

nativeDestroy

Added in 1.0.0-alpha06
protected final external void nativeDestroy(long handle)

nativeEndAccess

Added in 1.0.0-alpha06
protected final external int nativeEndAccess(long handle)