-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Eframe : Support for experimental webGPU backend #2137
Comments
switching from webgl to webgpu is actually trivial now - just change this field here https://github.com/emilk/egui/blob/master/crates/eframe/src/web/web_painter_wgpu.rs#L36 That said, what needs to be done is to either patch through the backend setting into the |
I'm not sure if my issue lies in getting the right combination. I used the latest version of canary and wgpu but I got some |
hmm that rings a bell, but don't recall where I saw this recently in this context. It's definitely not about the pecularities of WebGPU versions, but something on the codepath hits a lock when it really shouldn't. Can you run with |
I think I see the issue, my current wasm code uses My current main looks like this :
How would one adapt this to serve with |
ah, yes that's exactly what I hit as well recently! In cases like this one needs to pass control back to the browser. This is achieved by making application entry point itself async. In the egui demo that's done here https://github.com/emilk/egui/blob/master/crates/egui_demo_app/src/lib.rs#L84, i.e. as described in the documentation you linked. |
So I managed to get it to work with WebGPU, however, it looks like only the GL backend works in web assembly. Changing the line at https://github.com/emilk/egui/blob/master/crates/eframe/src/web/web_painter_wgpu.rs#L36 to use |
The rest of what you're writing sounds like you were still running it on WebGL :). For some reason wgpu figured it can't use a WebGPU wgpu::Device and the remaining WebGL device requires the smaller (downlevel) featuer set. |
Thanks for the quick answer. I did indeed try the boids and cube examples, and they work as expected on my system. As expected, the boids example only works on Chrome Canary, as it uses compute shaders. Which is why I'm puzzled about what is happening. Maybe something related to how the surface is created in eframe? It's the only part that seems handled a bit differently since the wgpu examples use winit to create the window and create a surface. |
alright then I'm as puzzled as you :). I'll give it another stab myself in the coming days, but can't promise anything. Meanwhile I'll put in a way to change backend/limits/etc from the outside without touching egui code |
That will probably help a lot for debugging thanks, I'll also check if I can make it work using a different approach for the surface creation. |
Ok I finally found the issue.. eframe's wgpu dependency uses the webgl dependency and therefore the |
Cargo dependencies are strictly additive. |
Good to know! I suppose this would be required then in order for people to fully opt into WebGPU support. |
Hi,
Recently quite a lot of development has been made on the webGPU side of things on egui (yay!), but right now, only the webgl2 backend seems supported on the web. I know this is probably very early, but I would be interested in getting compute shaders in the pipeline, which can only be done with webGPU. There is a great introduction to webGPU compute shaders here.
I spent some time trying to get a working webGPU backend (diregarding any compute pipeline for now) with Eframe but couldn't manage to get it to work.
First of all, is this something that would be relevant for Egui ? And has anybody tried something similar with any success? (Maybe @Wumpf which worked on #2107 ?)
Best,
Philippe
The text was updated successfully, but these errors were encountered: