-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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 0.10 #2556
Update to WGPU 0.10 #2556
Conversation
@@ -14,6 +14,7 @@ keywords = ["game", "engine", "gamedev", "graphics", "bevy"] | |||
license = "MIT OR Apache-2.0" | |||
readme = "README.md" | |||
repository = "https://github.com/bevyengine/bevy" | |||
resolver = "2" |
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.
This will do nothing for crates depending on Bevy and it doesn't seem needed here?
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.
I thought it was required for WGPU to build, but I'll have to double-check.
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.
The resolver v2 let's you specify features per target. While this PR doesn't need it, maybe it's needed internally by wgpu? That would be unfortunate...
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.
Yes WGPU needs it to compile now. I do remember it was a little difficult to make things work before without the new feature resolver, but it did work. If it is a problem for Bevy, we could discuss it with the WGPU folks, maybe. I don't know if it would be possible to go back to not needing it.
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.
resolver = "2"
will become the default in the 2021 edition.
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.
As a dependency can't specify to use the new resolver for the dependent crate, it's a little painful for now for libs to require it... This will change with edition 2021 in October 🎉
crates/bevy_wgpu/Cargo.toml
Outdated
@@ -29,7 +29,7 @@ bevy_winit = { path = "../bevy_winit", optional = true, version = "0.5.0" } | |||
bevy_utils = { path = "../bevy_utils", version = "0.5.0" } | |||
|
|||
# other | |||
wgpu = "0.9" | |||
wgpu = { version = "0.9", features = ["spirv"] } |
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.
Could you make that a git dependency to wgpu? While some jobs of CI will fail because of that, the others should work a little better
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.
Updated. For the glTF example to run we also need to patch Naga so I added a patch in there too. Since we can't actually merge until WGPU publishes another release, we can just take that and the git dependencies out when WGPU 0.10 comes out.
efa8a33
to
8a98d72
Compare
0.10 is released! Could you update this PR to that, then we can try and get it merged ASAP? |
I think we might want to wait until Rust 2021 releases (which should be a matter of days). That way we don't need to worry as much about "weird feature resolver stuff". |
This is wrong / some people on discord (and the wgpu matrix chat) corrected me. There is a good chance that it will land in rust 1.56, which is scheduled to release on October 21. Thats far enough out that we might need to rethink our approach / investigate the implications of releasing without the resolver default changes. |
Yeah, so just to put in my experience here so far. In almost every case I've tried to compile WGPU or a depenant project without There was one time where for some reason I did not get that message, because I ran into a compiler issue sometime before the crate that had that specific error message or something like that and it just failed some some error in another crate, but I think I was doing some weird dev stuff at the time and may have had patched crates, etc, so that might not happen to anybody else in practice. Also, as far as progress here, I've got a more up-to-date version of this branch locally, but I'm still trying to figure out how to get around the fact that swapchain textures are now a |
8a98d72
to
e258981
Compare
Finished updating to WGPU 0.10! The pipelined 2D renderer also works on OpenGL now, as long as you don't resize the screen, in which case the scale get's funky, but that's progress! The old renderer sprite and text examples don't work anymore because of a shader error, but the Do we want to fix the old renderer to work with WGPU 0.10, or is that not worth it? |
e258981
to
11bbf8d
Compare
I don't think this is worth the effort; we're about to migrate off it and this is the last release with the old renderer. |
OK, that's what I was thinking. Technically the old renderer is still compiling, and with WGPU 0.10, I'm not sure if we should leave it like that. For some reason CI fails on android and the examples fail to run, but those are both for the old renderer. Not sure exactly what our approach for this is, but let me know if there's anything else you want me to to do to this! |
By the time we pick up these changes, the old renderer will almost certainly be gone :) |
Just out of curiosity, what's happening with this PR? |
I'm using it to test Bevy with the latest WGPU changes so that I can work on getting OpenGL and WebGL2 support working. When we are ready, probably after Bevy's new renderer is ready to replace the old one, we will probably use this PR to update to the latest WGPU. |
Alright, thank you! |
Regarding wgpu
This is due to a change in
|
In anticipation of the upcoming wgpu 0.11 release, I created a branch that updates |
Yay! 🎉 You want me to close this then? There's no real reason to use it as-is. |
I'll leave that up to you. My branch builds on top of your work and does include you as a co-author on the commit. But I want to merge this on your terms (whatever that means). I also just realized that the branch I linked to isn't the right one. Here is the actual branch: https://github.com/cart/bevy/tree/upgrade-rebase |
Co-author on the commit is good enough for me. :) I'll close this and we can just worry about merging your new branch when the time comes. |
Upgrades both the old and new renderer to wgpu 0.11 (and naga 0.7). This builds on @zicklag's work here #2556. Co-authored-by: Carter Anderson <[email protected]>
Upgrades both the old and new renderer to wgpu 0.11 (and naga 0.7). This builds on @zicklag's work here #2556. Co-authored-by: Carter Anderson <[email protected]>
Objective
Solution
Known Issues
'Texture[0] does not exist', /home/zicklag/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/wgpu-core-0.10.0/src/hub.rs:129:32
.This is almost surely due to the drop order of fields related to the new
SurfaceFrame
that replacesSwapchainFrame
in WGPU 0.10 and just needs to be investigated.