androidx.webgpu.helper
Classes
Objects
Top-level functions summary
suspend WebGpu |
createWebGpu( |
Unit |
Initializes the native library. |
Extension functions summary
String |
|
suspend Bitmap |
GPUTexture.createBitmap(device: GPUDevice) |
GPUTexture |
Bitmap.createGpuTexture(device: GPUDevice) |
Long |
Long.roundDownToNearestMultipleOf(boundary: Int)Helpers for image dimension management. |
Int |
Int.roundDownToNearestMultipleOf(boundary: Int) |
Long |
Long.roundUpToNearestMultipleOf(boundary: Int) |
Int |
Int.roundUpToNearestMultipleOf(boundary: Int) |
Top-level functions
createWebGpu
Artifact: androidx.webgpu:webgpu
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
Artifact: androidx.webgpu:webgpu
suspend fun GPUTexture.createBitmap(device: GPUDevice): Bitmap
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.