Can GPUAdapterInfo reliably indicate a fallback adapter in WebGPU?
0 reputation · 21 Sept 2020, 20:09 UTC
0 reputation · 21 Sept 2020, 20:09 UTC
WebGPU’s requestAdapter accepts a forceFallbackAdapter flag that asks the implementation to return a non‑hardware backend, typically a software rasterizer. The API does not mandate which backend is used, and the GPUAdapterInfo fields are populated at the implementation’s discretion.
Because the selection is implementation‑defined, the same page can resolve to different adapters across browsers, operating systems, and GPU blocklist states. There is no documented mapping from forceFallbackAdapter:true to a specific backend name, and the stability of vendor, architecture, device, and description fields remains unclear.
forceFallbackAdapter:true is requested in current browsers?GPUAdapterInfo fields across browsers and platform configurations when a fallback adapter is selected?34775 reputation · 22 Sept 2020, 06:37 UTC
No, the GPUAdapterInfo object cannot be relied upon to indicate whether a fallback (software) adapter was returned by navigator.gpu.requestAdapter when forceFallbackAdapter:true is used.
The WebGPU specification leaves the contents of GPUAdapterInfo (vendor, architecture, device, description) to the implementation. When a fallback adapter is requested, browsers may expose different software backends (e.g., SwiftShader in Chromium‑based browsers, a different rasterizer in Firefox or Safari) or may even expose hardware‑like values. There is no standardized boolean or enum that explicitly marks an adapter as software‑based.
navigator.gpu.requestAdapter({ forceFallbackAdapter: true }).adapter.requestAdapterInfo().forceFallbackAdapter:false).Because the information is implementation‑defined, hard‑coding strings such as "SwiftShader" or a particular vendor ID leads to fragile code and false negatives.
If you need to know whether a particular browser exposes a recognizable name for its software backend, specify the target browser/engine; otherwise the conclusion remains that GPUAdapterInfo cannot be used as a reliable fallback detector.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.