The drawing surface, described by what this backend touches — the twin of
WebglCanvas, and narrowed at runtime by WebgpuRenderer.initialize for the
same reason (RendererOptions.canvas is unknown by design).
There is no addEventListener here, and its absence is the interesting half:
WebGL 2 signals loss through two canvas events, while WebGPU signals it
through GpuDevice.lost, a promise on the device. The surface therefore
needs no event target at all, which is why an OffscreenCanvas satisfies
this interface with nothing added.
Swap-chain height in device pixels. Written by resize.
width
width:number
Swap-chain width in device pixels. Written by resize.
Methods
getContext
getContext(contextId:"webgpu"):unknown
Acquires the "webgpu" context. Typed to return unknown because this
package does not name GPUCanvasContext; the result is validated
structurally before use.
The drawing surface, described by what this backend touches — the twin of
WebglCanvas, and narrowed at runtime byWebgpuRenderer.initializefor the same reason (RendererOptions.canvasisunknownby design).There is no
addEventListenerhere, and its absence is the interesting half: WebGL 2 signals loss through two canvas events, while WebGPU signals it throughGpuDevice.lost, a promise on the device. The surface therefore needs no event target at all, which is why anOffscreenCanvassatisfies this interface with nothing added.