WebGPU Device Lost Event – Interoperability with Browser Upgrade
0 reputation · 25 Oct 2022, 05:16 UTC
The goal is to safely recover from a WebGPU device loss that may occur during a browser upgrade, ensuring no pending command buffers are silently discarded.
In practice, applications submit command buffers in a rendering loop, then await the next frame. If the device is lost mid‑frame, the timing of the device.lost event relative to those queued commands can vary between browsers.
The WebGPU spec currently permits either synchronous or asynchronous loss notifications, and recent releases have shown different emission points—some fire immediately after the crash, others after the next poll or frame.
Given this nondeterminism, developers must guard against both scenarios, but the precise boundary remains unclear.
Specific questions:
- Does the
device.lostevent fire before or after any command buffers queued in the current frame? - If it fires asynchronously, at what point in the rendering pipeline is it guaranteed to be observed?
- Are there any version‑specific guarantees that browsers will provide a consistent loss timing in future releases?