Open
Description
Description
Enabling the "webgpu" backend can cause WebGL support to be lost.
Repro steps
- Use Firefox 123.0 on macOS.
- Set
dom.webgpu.enabled
to true. - Visit https://wgpu.rs/examples/?backend=webgl2&example=bunnymark
Expected vs observed behavior
Expected: The demo should display, using either webgpu or webgl2.
Observed: it fails to initialize:
CreateSurfaceError { inner: Web("canvas.getContext() returned null; webgpu not available or canvas already in use") }
WebGPU detection is presumably concluding WebGPU is supported because navigator.gpu
exists, but that is evidently not sufficient.
(Note that it is also possible for a canvas to return null for the context simply because it was previously used as "webgl2"
rather than "webgpu"
. That would be nice to support too, but since it would require a simultaneous WebGPU-or-WebGL2 backend, understandable to skip.)
Platform
- Firefox 123.0
- macOS
- wgpu 0.19.3