Reload an unattended display whose GPU context never comes back.
The last resort, and deliberately last. The viewer already recovers from
context loss on its own (scene/scene-manager/render-pipeline/ webgl-context-recovery.ts), and a reload throws away every warm cache the
display has built — on a large scene that is a visibly blank screen for
seconds. So this waits out a grace period and only fires if recovery has not
happened.
It listens on the canvas ITSELF rather than hooking the recovery module.
That is not a shortcut: DOM events have many listeners, so observing the same
webglcontextlost / webglcontextrestored pair needs no plumbing through
three layers, cannot interfere with recovery, and inherently gives recovery
first refusal — the grace timer is simply cancelled if the context returns.
WebGPU device loss has no canvas event and no recovery in this release, so it
arrives through onUnrecoverableLoss and always ends in the reload — after
the same grace period, which also spaces out reloads of a device that is
lost again at once.
Ports-injected (timers, reload, canvas) so a test can drive it without a
browser, and so nothing here reaches for a singleton it was not handed.
Reload an unattended display whose GPU context never comes back.
The last resort, and deliberately last. The viewer already recovers from context loss on its own (
scene/scene-manager/render-pipeline/ webgl-context-recovery.ts), and a reload throws away every warm cache the display has built — on a large scene that is a visibly blank screen for seconds. So this waits out a grace period and only fires if recovery has not happened.It listens on the canvas ITSELF rather than hooking the recovery module. That is not a shortcut: DOM events have many listeners, so observing the same
webglcontextlost/webglcontextrestoredpair needs no plumbing through three layers, cannot interfere with recovery, and inherently gives recovery first refusal — the grace timer is simply cancelled if the context returns.WebGPU device loss has no canvas event and no recovery in this release, so it arrives through
onUnrecoverableLossand always ends in the reload — after the same grace period, which also spaces out reloads of a device that is lost again at once.Ports-injected (timers, reload, canvas) so a test can drive it without a browser, and so nothing here reaches for a singleton it was not handed.