Skip to content

egui-wgpu api design #2022

Open
Open
@luiswirth

Description

@luiswirth

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. So Renderer::render_onto_renderpass would become Renderer::render and the current Renderer::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 😆)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions