Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@JasperBRiedel
Copy link
Contributor

This is a small patch to update the wgpu dependency from version 27.0.1 to 28.0.0. The changes are minor, requiring only a few updates to descriptor initializers for the updated multiview and immediates (formally push constants) fields.

The changes are working without any obvious issues in my own project. However, I've not yet been able to run the check script due to the extra dependencies required not being available in my development environment. I will attempt this again later.

Please note that wgpu now requires a minimum toolchain version of 1.92.0, so I have updated the rust-toolchain file accordingly. I'm not sure if the toolchain version change has larger implications for the project?

This is my first pull request. I'm hoping it meets the criteria for a small change, and therefore doesn't need an issue first.

@github-actions
Copy link

github-actions bot commented Dec 18, 2025

Preview available at https://egui-pr-preview.github.io/pr/7789-wgpu-update
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

View snapshot changes at kitdiff


[toolchain]
channel = "1.88.0"
channel = "1.92.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

Usually a proper and comprehensive MSRV bump is done first, see: #7579

JasperBRiedel and others added 19 commits December 20, 2025 10:30
Previously, when loading a variable font (e.g. via
`egui::FontData::from_static`),
the font was rendered using the default (often the lightest) weight,
ignoring any preferred weight configuration.

This change applies the specified weight to skrifa's `Location` for the
`wght` axis,
ensuring that variable fonts are rendered with the intended font weight.

## Summary
Fixes variable font weight not being applied during rendering. The
`FontData::weight()` method now properly configures the font variation
axis.

## Changes
- Add `location: Location` field to `FontFace` to store variation
coordinates
- Pass `location` parameter through to glyph rendering functions
- Apply weight to skrifa's `LocationRef` in `DrawSettings` and
`HintingInstance`

## Weight Priority
1. `preferred_weight` from `FontData::weight()`
2. OS/2 table's `us_weight_class` 
3. Variable font's fvar default value
4. `Location::default()`

## Related Issue
- emilk#3218 : Not follow font id, but goal would be same

## Todo
* [x] Apply preferred font weight when loading variable fonts
* [ ] Add small size variable fonts for docs and egui (need discussion)
@JasperBRiedel
Copy link
Contributor Author

JasperBRiedel commented Dec 21, 2025

The windows build is failing due to two different versions of the windows crate being used by dependencies (I think?).

This can be resolved by letting cargo regenerate Cargo.lock using cargo generate-lockfile.

I've not had an issue like this before, and I'm unsure of the broader implications of regenerating Cargo.lock.

Is this a reasonable fix?

@JasperBRiedel
Copy link
Contributor Author

Ah, it seems I've discovered the broader implications... We now fail the checks of the deny.toml 🙃

I'm not sure how to move forward with this now. Any input would be greatly appreciated.

@MeFisto94
Copy link

Without being an expert and especially knowing the context: Editing a lockfile is usually never the right choice. Not in Rust, not in nodeJS. If it were, there'd be no need to version the lockfile or have it after all. The lockfile pins all dependencies, especially transitives to the exact version (~ commit), to have "reproducable" builds. If those versions would change, you could have slight changes in behavior that are very hard to debug because they are unexpected.

Instead, one should always edit the Cargo.toml and have the resolver update the lock as a consequence, because after all you updating the WGPU version made it think that there are two versions of the windows crate necessary. If there weren't conflicting dependency versions, it would've tried to settle on one.

That's also the case at least for https://github.com/emilk/egui/actions/runs/20405854417/job/58635443776?pr=7789#logs partially, deny found out that we're having two versions of the png crate as well somewhere in the hierarchy (and conveniently prints us the hierarchy). Additionally, deny found some dependencies with unsupported licenses, this could be the direct result of updating the lock file: Dependencies changed their dependencies and now include dependencies with unknown licenses or changed their license.

Alright, if we revert back to 209ec7a. If you use cargo tree -i windows, it tells you:

error: There are multiple `windows` packages in your project, and the specification `windows` is ambiguous.
Please re-run this command with one of the following specifications:
  [email protected]
  [email protected]

For 0.61.1:

windows v0.61.1
├── accesskit_windows v0.29.1
│   └── accesskit_winit v0.29.1
│       └── egui-winit v0.33.3
...
└── gpu-allocator v0.28.0
  └── wgpu-hal v28.0.0
      ├── wgpu v28.0.0
      │   ├── eframe v0.33.3

And for 0.62.2:

windows v0.62.2
└── wgpu-hal v28.0.0
    ├── wgpu v28.0.0
    │   ├── eframe v0.33.3

So, my guess is that the culprit is accesskit_windows/accesskit_winit needing a bump to a version where they used 0.62.2 as well. It shouldn't be a problem with gpu-allocator v0.28.0, because clearly wgpu-hal's dependency on windows would be faulty, then. I guess it just chose the lower one by default.

And then, you'll be looking at png, where we saw the problem as well in the deny reports.

@zachmeyer
Copy link

zachmeyer commented Dec 23, 2025

For what it's worth, I am using this pull request currently to allow myself to use WGPU v28, and I have no issues, including a resolution to the double windows dependency issue I was having when I first upgraded to WGPU 28. I am building on windows 11 25H2 26220.7523 in release mode using the nightly toolchain.

Here is my cargo.toml (the pertinent parts) - don't judge if something is weird, I am not well-versed in these config files yet and I am positive I am doing some goofy things:

[workspace.dependencies]
# 3rd Party
bytemuck = { version = "1.23.2", features = ["derive"] }
egui = { git = "https://github.com/emilk/egui.git", rev = "4a9fc7e6417b9ca838b880f2a89fd16468aece67" }
egui-wgpu = { git = "https://github.com/emilk/egui.git", rev = "4a9fc7e6417b9ca838b880f2a89fd16468aece67", features = ["winit"] }
egui-winit = { git = "https://github.com/emilk/egui.git", rev = "4a9fc7e6417b9ca838b880f2a89fd16468aece67" }
image = { version = "0.25", default-features = false, features = ["png", "jpeg"] }
parking_lot = { version = "0.12.4", features = ["send_guard"] }
serde = { version = "1.0", features = ["derive"] }
wgpu = { version = "^28.0", default-features=false, features=["wgsl", "std", "parking_lot", "dx12"] }

anyhow = "1.0"
bincode = "1.3"
bitflags = "2.10"
dashmap = "6.1"
env_logger = "0.11.8"
log = "0.4.28"
lz4 = "1.28"
noise = "0.9"
paste = "1.0"
rand = "^0.10.0-rc.5"
rayon = "1.11.0"
serde_json = "1.0"
smol = "2.0.2"
winit = "0.30"

Not sure if this will help or is relevant, but figured maybe I'd share just in case.

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.

5 participants