-
Notifications
You must be signed in to change notification settings - Fork 946
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
Fix AnyDevice drop implementation dropping the wrong thing #6052
Conversation
52ae707
to
ef6d584
Compare
(force push to fill in the changelog pr numbers, no other change) |
* Fixes #4874 * Details see gfx-rs/wgpu#6052
Simple test that inits every possible resource (device, buffer, texture, ...) and then runs all permutations of drops. |
that would be a good unit test to have regardless indeed! The main problem specifically here though is that we need to create a |
Maybe xvfb-run can help (for linux), that's what we use in servo. |
# Conflicts: # CHANGELOG.md
* Fixes emilk#4874 * Details see gfx-rs/wgpu#6052
* Fixes emilk#4874 * Details see gfx-rs/wgpu#6052
Connections
SIGSEGV
on demo_app quit afterwgpu
22.0.0 update emilk/egui#4874AnyDevice
can hopefully go away soon as part of my ongoing generification workPost-merge edit:
Description
There is a crash report in egui after wgpu update. Quickly realized that this happens only when the surface is destroyed after the all other resources are dropped. Which leads to this simple repro in
hello_triangle
(cc: @cwfitzgerald any idea how I can unit-testify this? :/)Unknown why this happened after wgpu 22.0.0 update, I strongly suspect the error is older and just surfaces (hah!) now because of improving ownership hygiene in the project.
A shining case of "How did this ever work?"
(A: this still drops the right ref count, so this is ONLY an issue if the last droping of
Arc<Device<A>>
happens throughAnyDevice
which is surprisingly rare)Testing
Above manual test works now
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.