Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions quest/m1/webgpu-renderer.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,18 @@ added this quest). Re-planned from issue #703, whose stub quest the
default) picks WebGPU where supported, else Canvas2D, and logs the choice.
An explicit `"webgpu"` where it is missing refuses loudly; only `"auto"`
falls back.
- Device loss: request a new device and rebuild the pipeline. If no adapter
comes back, `"auto"` switches to Canvas2D (logged) rather than going black.
A canvas that acquired a `webgpu` context never returns a `2d` one, even
after device loss, and the canvas is caller-owned (the `<canvas>` child of
`<moq-watch>` or `<moq-publish>`, or a transferred `OffscreenCanvas`). Open:
who supplies the replacement surface for this fallback, including in the
worker. Settle it with the maintainer before building the fallback.
- Device loss: request a new device and rebuild the pipeline. A canvas that
acquired a `webgpu` context never returns a `2d` one, and the canvas is
caller-owned, so when no adapter comes back the renderer fails loud:
rendering stops and `out.error` reports `"surface-lost"`. Like the video
source's `out.error`, it is a string union, `undefined` while healthy.
Recovery is a fresh canvas on the existing `canvas` input, which clears
the error; with `"auto"` the renderer then re-selects (Canvas2D if WebGPU
is still gone). `<moq-watch>` and
`<moq-publish>` do this themselves by swapping their `<canvas>` child for a
fresh one with the same attributes. In the worker, the main thread
transfers a new `OffscreenCanvas`. Decided 2026-10-08. Rejected: a canvas
factory input (a callback), and a dead renderer the app must rebuild.
- The renderer takes an `HTMLCanvasElement` or an `OffscreenCanvas`, so the
[watch worker](/quest/m1/watch-worker.md) move transfers the canvas and
carries this renderer over unchanged. This lands first, on the main thread,
Expand All @@ -65,11 +70,12 @@ added this quest). Re-planned from issue #703, whose stub quest the
`"webgpu"` refuses where missing), rotation and flip parity between the two
paths, device-loss recovery, and the preview's rotation. The fallback
test runs in a real browser: paint with WebGPU, lose the device with no
adapter to recover, then check Canvas2D actually paints.
adapter to recover, check `out.error` reports it, then check the element's
swapped canvas actually paints through Canvas2D.

Public API: new `@moq/video` package; a `renderer` attribute and option on
`<moq-watch>` and `<moq-publish>`; the publish preview's renderer moves to
the shared one. Wire: none.
`<moq-watch>` and `<moq-publish>`; the renderer's `out.error` output; the
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
publish preview's renderer moves to the shared one. Wire: none.

## Closes

Expand Down
Loading