-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[wgpu-hal] Upgrade glutin to 0.31
#6150
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
Conversation
|
|
Regarding the build-failure, |
a22cada to
0181b88
Compare
|
The duplicate |
dc33e03 to
c28fa09
Compare
cwfitzgerald
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good in general, some small questions
`glutin 0.30` onwards completely refactored its internals to no longer be reliant on `winit`, as they (by default) have no direct relation except needing to perform _some_ operations (platform-specific) at strategic times in window creation and event loop handling. Most of that is handled by a new `glutin-winit` introp crate, while the core `glutin` crate now exclusively focuses on wrapping the various OpenGL context APIs (CGL, EGL, WGL, ...). This does result in a little more verbose handling to get the right `GLDisplay`, `GLConfig`, `GLContext` and `GLSurface`, but gives much more control and makes all intricacies more explicit. Most of the code was copied from `glutin 0.31`'s example crate, with the code for transparency support removed. Note that the example doesn't at all handle event loop events properly: resizes and redraws are not listened to, and mobile-specific surface events (`Resumed` and `Suspended`) are equally ignored.
cwfitzgerald
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
PR gfx-rs#6150 suffered a much larger rebase "hell" than I anticipated. On my Linux box I made this change, but lost it while force-pushing from Windows (and created some other compiler errors while at it...). By disabling all features on `glutin`/`glutin-winit` (the latter only uses `x11`, and only forwards `wayland` to `glutin`) we may have dropped a lot of "unused" dependencies for other GL backends, but also made the crate unable to import X11 (Xlib/Xcb) and Wayland handles into EGL. Also import the missing `glutin::context::Version` struct again which was added last-minute to gfx-rs#6150 (to make sure my Intel card on Windows creates a GLES 3.0+ instead of GLES 2.0 context) while the import was accidentally squashed into gfx-rs#6152 (not merged yet).
PR #6150 suffered a much larger rebase "hell" than I anticipated. On my Linux box I made this change, but lost it while force-pushing from Windows (and created some other compiler errors while at it...). By disabling all features on `glutin`/`glutin-winit` (the latter only uses `x11`, and only forwards `wayland` to `glutin`) we may have dropped a lot of "unused" dependencies for other GL backends, but also made the crate unable to import X11 (Xlib/Xcb) and Wayland handles into EGL. Also import the missing `glutin::context::Version` struct again which was added last-minute to #6150 (to make sure my Intel card on Windows creates a GLES 3.0+ instead of GLES 2.0 context) while the import was accidentally squashed into #6152 (not merged yet).
Connections
Closes #5649 and should help towards #5709 where
raw-window-handlecan be used.Description
glutin 0.30onwards completely refactored its internals to no longer be reliant onwinit, as they (by default) have no direct relation except needing to perform some operations (platform-specific) at strategic times in window creation and event loop handling. Most of that is handled by a newglutin-winitintrop crate, while the coreglutincrate now exclusively focuses on wrapping the various OpenGL context APIs (CGL, EGL, WGL, ...).This does result in a little more verbose handling to get the right
GLDisplay,GLConfig,GLContextandGLSurface, but gives much more control and makes all intricacies more explicit. Most of the code was copied fromglutin 0.31's example crate, with the code for transparency support removed.Note that the example doesn't at all handle event loop events properly: resizes and redraws are not listened to, and mobile-specific surface events (
ResumedandSuspended) are equally ignored.Testing
cargo r --example raw-glesonwaylandonly with an AMD GPU and Mesa drivers (for now).Checklist
cargo fmt.cargo clippy. If applicable, add:--target wasm32-unknown-unknown--target wasm32-unknown-emscriptencargo xtask testto run tests.CHANGELOG.md. See simple instructions inside file.