-
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
egui-wgpu api design #2022
Comments
I am trying to come up with an alternative design in https://github.com/coderedart/etk it has |
@coderedart That sounds great! I will take a look :) |
This sounds good to me. |
That part got implemented. It might make sense to have a crate that just takes care of winit and then in turn has features for supporting different rendering backends - ideally through a shared interface. |
In my opinion there are a couple of flaws with the current egui-wgpu api.
(Note: I'm going to use the new names from #2021)
I had a discussion with some folks from wgpu and we came to the conclusion, that there shouldn't be a
Renderer::render
that creates it's own render pass. You should always have to give in your own render pass. SoRenderer::render_onto_renderpass
would becomeRenderer::render
and the currentRenderer::render
would be removed.Every time egui-wgpu is used directly the user should create it's own render pass and adjust it to their needs (msaa, depth texture, etc). This would also allow us to remove things like the depth texture from here and only have eframe care about it. egui-wgpu shouldn't care about this.
Also the winit feature of egui-wgpu is weird in my opinion. egui-wgpu should only be a thin wrapper around a
wgpu::RenderPipeline
together with some resources. It should only care about wgpu. The combination of wgpu and winit should be handled outside of this crate. For instance in eframe or some other crate like my old eww (egui + winit + wgpu) crate.(I also believe that eframe should entirely depend on egui-winit for both web and native, but that's a different issue #2023 )
I think a clear separation of these things would really help, because right now I don't like the api I'm presented with when creating my own integration without eframe.
(Also issue number #2022 😆)
The text was updated successfully, but these errors were encountered: