WebGL support questions #2468
-
I'm working on a non-trival wasm webgl project and want use wgpu as the future hal to support both webgl and webgpu or native, but after some prototyping, I think there are some issues and rough edges need to disscuss and resolve: Should we put WebGL support at wgpu's abstraction layer instead of wgpu-hal's opengl backend, to avoid entire useless(for webgl) resource management, sync, validation logic in wgpu-core, to reduce the binary size and runtime overhead? Is webgl1 support possible? For my case I have to consider 1-5% case user even dont have webgl2. Is webgl support works well / try their best? Some feature seems not supported well(but maybe could). I known the first class support for webgl is maybe not the wgpu's responisblity. Is their any plan or other's open source project that working on a clean hal layer over webgpu and webgl for wasm in rust? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello! Thanks for filing!
Not meaningfully, there's a ton that is different between the binding model of webgl1 and webgl2.
At it's core we can only formally promise best effort, but for all the downlevel platforms, we do want to support as much as possible as best we can. Any particular features that come to mind?
There's still a bit that needs to go on inside of wgpu-core to run on GL, mainly binding and shader translation. Additionally the cost of validation itself is not particularly significant. Sync generation and lifetime management is an interesting thing, I've thought before that for WebGL/DX11 we should see if we could disable them as they are unnecessary. Sync generation is getting a (hopeful) speedup soon, so the effect will be less pronounced, but I think it is still worth investigating. |
Beta Was this translation helpful? Give feedback.
Hello! Thanks for filing!
Not meaningfully, there's a ton that is different between the binding model of webgl1 and webgl2.
At it's core we can only formally promise best effort, but for all the downlevel platforms, we do want to support as much as possible as best we can. Any particular features that come to mind?