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

Update to wgpu-core 0.20.0 #387

Closed
wants to merge 1 commit into from
Closed

Update to wgpu-core 0.20.0 #387

wants to merge 1 commit into from

Conversation

almarklein
Copy link
Collaborator

@almarklein
Copy link
Collaborator Author

I'm attempting to update, but my I'm somewhat overwhelmed by the Rust type errors:

E.g. I get a ton of these; is the suggestion from the Rust compiler the way to go?

error[E0599]: no method named `as_mut` found for struct `Id` in the current scope
    --> src/lib.rs:4293:32
     |
4293 |     let encoder = pass.encoder.as_mut().unwrap();
     |                                ^^^^^^ method not found in `Id<RenderPassEncoder>`
     |
    ::: /Users/almar/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/convert/mod.rs:372:8
     |
372  |     fn as_mut(&mut self) -> &mut T;
     |        ------
     |        |
     |        the method is available for `Box<Id<RenderPassEncoder>>` here
     |        the method is available for `Box<&mut Id<RenderPassEncoder>>` here
     |        the method is available for `Box<&Id<RenderPassEncoder>>` here
     |
help: consider wrapping the receiver expression with the appropriate type
     |
4293 |     let encoder = Box::new(pass.encoder).as_mut().unwrap();
     |                   +++++++++            +
help: consider wrapping the receiver expression with the appropriate type
     |
4293 |     let encoder = Box::new(&mut pass.encoder).as_mut().unwrap();
     |                   +++++++++++++             +
help: consider wrapping the receiver expression with the appropriate type
     |
4293 |     let encoder = Box::new(&pass.encoder).as_mut().unwrap();
     |                   ++++++++++            +

@almarklein almarklein mentioned this pull request May 23, 2024
18 tasks
@rajveermalviya
Copy link
Collaborator

Yeah there are quite a lot of changes needed, here's my branch that I was working a while ago, it compiles and runs but has a ref counting race condition somewhere for the surface, so it segfaults at exit. I didn't get much time to work on finding it though.

@rajveermalviya
Copy link
Collaborator

(Feel free to pull those changes in this PR :))

@almarklein
Copy link
Collaborator Author

Ah, great to see you've already made the changes. That segfault sounds bad. I might also have a look.

@almarklein
Copy link
Collaborator Author

almarklein commented May 24, 2024

I reviewed your changes, and it looks fine to me (albeit my Rust knowledge is limited). I especially checked the code related to surfaces, but cannot find anything suspicious of why the race condition was introduced. I also don't get a segfault on MacOS.

@rajveermalviya
Copy link
Collaborator

rajveermalviya commented Jun 6, 2024

This gfx-rs/wgpu#5637 may be related, it's fix is added as a backport, so maybe will need to wait till next point release.
(I still need to verify by moving to wgpu trunk)

Update: It doesn't fix it unfortunately, but it's related to our Arc usage for Surface + Device.

@ygdrasil-io
Copy link
Contributor

Is it possible to publish a version even if we have some memory issue on it ?
The issue could be track and fix on a futur minor version, so, peoples waiting for bugfixes/new features are not block.

@rajveermalviya
Copy link
Collaborator

The segfault turned out to be fixed via gfx-rs/wgpu#6052, #402 updates wgpu to v22.1.0 which includes that fix and no longer segfaults.

@almarklein almarklein closed this Aug 25, 2024
@almarklein almarklein deleted the bump-to-0.2.0 branch September 4, 2024 13:22
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.

3 participants