-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Dynamic WebGPU support detection #2804
Copy link
Copy link
Closed
Labels
area: apiIssues related to API surfaceIssues related to API surfacebackend: webgpuIssues with direct interface with WebGPUIssues with direct interface with WebGPUhelp requiredWe need community help to make this happen.We need community help to make this happen.type: enhancementNew feature or requestNew feature or request
Metadata
Metadata
Assignees
Labels
area: apiIssues related to API surfaceIssues related to API surfacebackend: webgpuIssues with direct interface with WebGPUIssues with direct interface with WebGPUhelp requiredWe need community help to make this happen.We need community help to make this happen.type: enhancementNew feature or requestNew feature or request
Is your feature request related to a problem? Please describe.
It's not really a problem at the moment, because no stable browser has WebGPU support turned on by default, yet. In the future, it would be great to be able to ship a single binary in WASM that supports both WebGL and WebGPU, depending on browser support.
Currently this is impossible, as selecting the
webglcrate feature automatically disables the WebGPU backend.Describe the solution you'd like
Detecting WebGPU support in the browser is fairly easy. So depending on it's availability, the correct backend should be chosen automatically by
wgpu.Describe alternatives you've considered
The only solution I can come up with right now, is to have two binaries. Either detect support in the browser and load the appropriate WASM binary, or ship the appropriate binary by the server depending on the requesting browser.