Skip to content
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

gles: fix crash when holding multiple devices on wayland/surfaceless. #5351

Merged
merged 1 commit into from
Mar 10, 2024

Conversation

ashdnazg
Copy link
Contributor

@ashdnazg ashdnazg commented Mar 5, 2024

Connections
Closes #5349

Description
See #5349 for the crash.

Unfortunately the global state of EGL forces us to do our own global state for reference counting the displays.

Testing
Added a test that crashed before and passes now.

Checklist

  • Run cargo fmt.
  • Run cargo clippy.
  • Run cargo xtask test to run tests.
  • Add change to CHANGELOG.md. See simple instructions inside file.

@ashdnazg ashdnazg requested a review from a team as a code owner March 5, 2024 23:36
@ashdnazg
Copy link
Contributor Author

ashdnazg commented Mar 6, 2024

There's a bit of a mess with the tests, apparently the regular #[test] functions are not tested in the CI.
I converted the device ones to gpu tests so at least they run, but it's kinda ugly with the context initialising its own adapter and device in advance.

@ashdnazg ashdnazg force-pushed the feature/fix-multiple-devices branch 2 times, most recently from 936820d to 3920581 Compare March 6, 2024 07:28
@Wumpf Wumpf self-requested a review March 9, 2024 09:22
Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you and great you added a test to catch this issue as well!
The locking logic needs another pass though I believe (see comment)

There's a bit of a mess with the tests, apparently the regular #[test] functions are not tested in the CI.

yes, all that gpu testing is a bit tricky on CI (:

wgpu-hal/src/gles/egl.rs Outdated Show resolved Hide resolved
wgpu-hal/src/gles/egl.rs Outdated Show resolved Hide resolved
@ashdnazg ashdnazg force-pushed the feature/fix-multiple-devices branch 2 times, most recently from 6ad6df2 to 1ac9349 Compare March 9, 2024 11:32
@ashdnazg ashdnazg force-pushed the feature/fix-multiple-devices branch from 1ac9349 to 38bb236 Compare March 9, 2024 11:40
@ashdnazg
Copy link
Contributor Author

ashdnazg commented Mar 9, 2024

Should be fixed now.

@ashdnazg ashdnazg requested a review from Wumpf March 9, 2024 12:07
Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great stuff, thanks for documenting everything in detail now!

@Wumpf Wumpf merged commit 8e15707 into gfx-rs:trunk Mar 10, 2024
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash when creating multiple GL devices on wayland/surfaceless.
2 participants