Expand description
WASM target support for browser-based GPU compute via WebGPU.
This module is conditionally compiled on wasm32 targets (or when the wasm
feature is enabled for native testing) and provides browser-friendly wrappers
around the wgpu WebGPU backend.
§Architecture
+-------------------------------------------+
| JavaScript / Browser |
+-------------------+-----------------------+
|
+-------------------v-----------------------+
| WasmGpuDevice / WasmBackend (wasm32) |
+-------------------+-----------------------+
| delegates to
+-------------------v-----------------------+
| WebGpuBackend (wgpu web-sys backend) |
+-------------------------------------------+§Usage
The WasmBackend wraps the existing WebGpuBackend
and adds browser-specific initialisation methods such as
init_from_canvas.
The WasmMemoryManager provides async-friendly buffer staging suited to the
browser event loop.
Structs§
- Wasm
Backend - WebGPU compute backend for WASM (browser) targets.
- Wasm
GpuDevice - A WebGPU device obtained from the browser’s
navigator.gpuAPI. - Wasm
Memory Manager - Browser-side buffer manager that uses async
map_asyncstaging.
Functions§
- request_
adapter - Request a WebGPU adapter from the browser.