Skip to main content

Module gpu

Module gpu 

Source
Expand description

WebGPU-style GPU resource management for guest wasm modules.

This module implements a sandboxed GPU API inspired by the WebGPU specification. Guest modules can create buffers, textures, shaders, and pipelines, then submit draw calls or compute dispatches — all mediated through the host capability system.

Resources are identified by opaque u32 handles; the host owns the actual wgpu objects and enforces limits (maximum buffer size, texture dimensions, shader compilation timeouts, etc.).

Structs§

GpuState
Per-module GPU state: device, queue, and resource tables.

Functions§

init_gpu
Initialise the wgpu device and queue, returning a ready-to-use GpuState.

Type Aliases§

GpuHandle
Opaque handle type for GPU resources visible to the guest.