androidx.webgpu.helper


Classes

Objects

Top-level functions summary

suspend WebGpu
createWebGpu(
    surface: Surface?,
    instanceDescriptor: InstanceDescriptor,
    requestAdapterOptions: RequestAdapterOptions,
    deviceDescriptor: DeviceDescriptor
)
Unit

Initializes the native library.

Extension functions summary

Top-level functions

createWebGpu

suspend fun createWebGpu(
    surface: Surface? = null,
    instanceDescriptor: InstanceDescriptor = InstanceDescriptor(),
    requestAdapterOptions: RequestAdapterOptions = RequestAdapterOptions(),
    deviceDescriptor: DeviceDescriptor = DeviceDescriptor( deviceLostCallback = defaultDeviceLostCallback, deviceLostCallbackExecutor = Executor(Runnable::run), uncapturedErrorCallback = defaultUncapturedErrorCallback, uncapturedErrorCallbackExecutor = Executor(Runnable::run), )
): WebGpu

initLibrary

fun initLibrary(): Unit

Initializes the native library. This method should be called before making and WebGPU calls.

Extension functions

createBitmap

suspend fun GPUTexture.createBitmap(device: GPUDevice): Bitmap

createGpuTexture

fun Bitmap.createGpuTexture(device: GPUDevice): GPUTexture

roundDownToNearestMultipleOf

fun Long.roundDownToNearestMultipleOf(boundary: Int): Long

Helpers for image dimension management. Each adds a method to round to the next higher or lower multiple of a value, e.g., "round -1,234 down to the nearest multiple of 1,000" returns -2000.

roundDownToNearestMultipleOf

fun Int.roundDownToNearestMultipleOf(boundary: Int): Int

roundUpToNearestMultipleOf

fun Long.roundUpToNearestMultipleOf(boundary: Int): Long

roundUpToNearestMultipleOf

fun Int.roundUpToNearestMultipleOf(boundary: Int): Int