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

chore: update wgpu to 0.19 #427

Closed
wants to merge 7 commits into from
Closed

Conversation

crowlKats
Copy link
Contributor

@crowlKats crowlKats commented Jan 30, 2024

Also updates winit due to raw-window-handle changes

Copy link
Member

@DJMcNab DJMcNab left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for doing this. Some comments from a first pass

I've not run the example yet

Can you please link #411?

examples/with_winit/src/lib.rs Outdated Show resolved Hide resolved
Key::Named(NamedKey::Space) => {
transform = Affine::IDENTITY;
}
Key::Character("s") => {
Copy link
Member

Choose a reason for hiding this comment

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

Same concern about caps lock for all of these

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So regarding caps lock: I didn't consider it even, thinking winit would ignore modifiers, and act like it used to before.
I reworked the code: Winit does expose a way to ignore modifiers on key via a KeyEventExtModifierSupplement trait, however oddly enough its not exposed for a web target, so we cannot use it here, so now will just use to_lowercase.

Copy link
Member

@DJMcNab DJMcNab left a comment

Choose a reason for hiding this comment

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

Sorry it's taken a while to review, I've taken a few weeks off.
Overall, this looks like a good update, thanks.

Unfortunately, this no longer compiles for Android. I needed to make two changes for that to work:

  1. Adding the suggested expect - I have not yet dug into why this is now fallible in winit. I can do so if you want
  2. Changing the run command to cargo apk run -p with_winit --lib (that is, the wrong command is documented in the README). I don't know why this change was necessary, but I also need it on main, so it's not a result of this PR.

We will likely add CI for android at some point, but that isn't currently present

"q" | "e" => {
if let Some(prior_position) = prior_position {
let is_clockwise = char == "e";
let angle = if is_clockwise { -0.05 } else { 0.05 };
Copy link
Member

Choose a reason for hiding this comment

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

I'm seeing some weird behaviour here, where pressing e now rotates anticlockwise

However, this is also present on main, so that's not an issue from this PR.

stats_shown = !stats_shown;
}
"d" => {
complexity_shown = !complexity_shown;
Copy link
Member

Choose a reason for hiding this comment

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

This no longer works on my machine, but this is also a pre-existing issue from before this PR

@DJMcNab DJMcNab linked an issue Feb 12, 2024 that may be closed by this pull request
Keavon added a commit to GraphiteEditor/Graphite that referenced this pull request Feb 17, 2024
`specta` from Hypercube's fork commit to latest upstream commit
`wasm-bindgen` 0.2.87 -> 0.2.91
`spirv-std` from 0.9 to not-yet-merged commit in EmbarkStudios/rust-gpu#1115
`wgpu` 0.17 -> 0.19
`winit` 0.28.6 -> 0.29
`vello` and `vello_svg` from latest upstream commit to not-yet-merged commit in linebender/vello#427
`resvg` 0.36.0 -> 0.39
`glam` 0.24 -> 0.25
`rustybuzz` 0.8.0 -> 0.10.0
`js-sys` and `web-sys` 0.3.55 -> 0.3.67
`usvg` 0.36.0 -> 0.39
`spirv` 0.2.0 -> 0.3

* Update a couple of dependencies

* More test fixing…

* Use upstream Specta instead of fork

* Update comments in Cargo.toml

---------

Co-authored-by: Keavon Chambers <[email protected]>
@ratmice
Copy link
Contributor

ratmice commented Feb 19, 2024

I was just about to make a similar PR, and before doing it forgot to look if there were any outstanding.
The only major difference was making the utils::create_surface use the safe create_surface API, and the ramifications for that to with_winit::RenderState having to move the window variable out to just being in the run loop.

https://github.com/ratmice/vello/tree/update_wgpu

If that kind of change is wanted I could perhaps make a separate PR for it once this one goes in?

Unfortunately, this no longer compiles for Android. I needed to make two changes for that to work:

Adding the suggested expect - I have not yet dug into why this is now fallible in winit. I can do so if you want

I had a bit of trouble figuring out which expect this is referring to, perhaps at the end of run?

@DJMcNab
Copy link
Member

DJMcNab commented Feb 19, 2024

The expect which is in the compilation failure message? This is at:

    let event_loop = EventLoopBuilder::with_user_event()
        .with_android_app(app)
        .build();

I haven't investigated why this is fallible yet

@DJMcNab DJMcNab mentioned this pull request Feb 19, 2024
@ratmice
Copy link
Contributor

ratmice commented Feb 19, 2024

Ahh, I see. The fallibility here is in the platform-independent part of winit:
0.28 EventLoopBuilder::build vs 0.29 EventLoopBuilder::build, where with_android_app returns a normal EventLoopBuilder.

It looks like it only errors in the case that you call build() multiple times, which in 0.28 was a panic.
So adding an expect there would just be continuing that panic tradition.

@DJMcNab
Copy link
Member

DJMcNab commented Feb 19, 2024

Closing, as this PR was merged as #444

Thanks for kicking this off!

@DJMcNab DJMcNab closed this Feb 19, 2024
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.

Update raw-window-handle dependency
3 participants