-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Description
What problem does this solve or what need does it fill?
Currently users need to compile and serve separate wasm binaries if they want to target both webgl2 and webgpu. Currently if you're making something targeting web, webgl2 is essential due to its much wider compatibility, while in my experience webgpu tends to run better (at least on very recent versions of chrome).
What solution would you like?
Being able to ship a single wasm binary targeting both webgpu and webgl2 simplifies both building and serving wasm binaries for web games/apps. Upgrading wgpu to 0.19 now allows us to compile a single binary that can choose at runtime to use webgl2 or webgpu.
What alternative(s) have you considered?
Continue requiring separate wasm binaries for webgpu and webgl2. I'm not sure how much larger a wasm binary targeting both webgl2 and webgpu might be compared to one that only targets webgl2 (or webgpu), but wasm binary sizes are also something to consider.
Additional context
Due to webgl2's limitations (no compute shaders, no storage buffers, etc) we'll still want to be able to ship wasm binaries that only target webgpu and not webgl2.
There are currently a lot of places where we change constants or add padding to structs based on whether or not we're targeting webgl2 on wasm, which all need to be rewritten to support this.