-
Notifications
You must be signed in to change notification settings - Fork 933
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
[wgpu-hal] Allow importing external WGL contexts as with EGL #6152
Conversation
Still WIP because ad-hoc (un)currenting the imported context creates a mess - I have to check how EGL importing is implemented. If only |
ee79685
to
3aef20e
Compare
31e084e
to
55184ee
Compare
55184ee
to
a15c47c
Compare
@ErichDonGubler can you review this one? I prefer to clean up the |
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).
😬 Iiii don't consider myself really qualified to review GL-related code, since I'm thoroughly unfamiliar with GL abstractions, but I'm happy to give it a shot and disclaim what I don't know! I've migrated some In particular, I don't know much about what conditions GL contexts need to be made current, when they might not be current, and what is safe and unsafe to do when they're not current. Will finalize review after that (#6152 (comment)), then. For now, I don't have any questions I expect will be useful to ask until more substantial review is satisfied. |
a15c47c
to
a0d2102
Compare
a0d2102
to
3436078
Compare
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.
Since it seems we've already shipped unsafe
APIs that conflict with the Soundness Property, I'm willing to defer reconciliation with it until after this PR.
makes my teeth chatter tho 😬
3436078
to
2c1ea94
Compare
I was similarly frightened when opening this code for the first time, hence brought up |
2c1ea94
to
52c4fdd
Compare
Connections
Depends on #6150
Description
Allows importing an external WGL context into
wgpu
to run theraw-gles
example.Testing
Checklist
cargo fmt
.cargo clippy
. If applicable, add:--target wasm32-unknown-unknown
--target wasm32-unknown-emscripten
cargo xtask test
to run tests.CHANGELOG.md
. See simple instructions inside file.