Core guide

WebGPU runtime

Create a secure-context WebGPU renderer and draw deterministic frames.

Live example

See WebGPU runtime in action

See the production WebGPU renderer create a surface and draw a frame.

live rendering loading ticks 0

How it works

The renderer owns the adapter, device, canvas context, pipelines, textures, samplers, and readback path. Device loss is reported as a typed game error.

Public types

  • WebGpuRenderer
  • WebGpuRendererOptions
  • WebGpuUnavailableError
  • GameDeviceLostError

Minimum viable example

const renderer = await create_webgpu_renderer({ canvas, width: 800, height: 450 });
const pixels = await renderer.clear({ red: 0, green: 0, blue: 0, alpha: 1 });
renderer.dispose();

Scope and limitations

Custom shaders, render targets, and advanced GPU resource APIs are deferred.