gfx-rs/wgpu

Use glutin for OpenGL context creation

valaphee opened this issue · 2 comments

Is your feature request related to a problem? Please describe.
Currently only EGL and WGL are supported, and not for example CGL which would enable OpenGL on Apple (without ANGLE), or GLX to use indirect OpenGL and reach older platforms.

Describe the solution you'd like
Using https://github.com/rust-windowing/glutin which seems to be well organized, it is also used by egui to create the OpenGL context for their glow variant.

Would also solve the TODOs and probably the issue I had with Wayland where its not running at all.

License is compatible, MSRV is similar, wouldn't introduce any new dependencies, and is maintained.

Describe alternatives you've considered
Implementing CGL, GLX ourself, even though strictly speaking, both are optional as there are workarounds, except for indirect OpenGL which no one uses anyway.

Additional context

wgpu used to use glutin and surfman at times but moved away from it a while ago. The main reasons we moved away from them were that we didn't need most of what the abstractions provided, and we need access to extensions at the EGL/WGL/etc. level anyway (context/surface creation order to match wgpu, resource sharing, etc.).

There's some discussion across wgpu and gfx (the original backend for wgpu) if you're interested:
gfx-rs/gfx#3468
gfx-rs/gfx#3151
#450

Because of the history I think we'd probably want to avoid glutin for now unless there's a pretty strong reason to reintroduce an abstraction at that level. I'm not sure there's too much value in trying to support CGL right now since we already have a couple options that work well there (Metal being the preferred backend for Apple).

Wumpf commented

(seems like there's no further arguments in either direction, so closing as Won't Fix. Please re-open if new information emerges)