Skip to content

Commit

Permalink
Upgrade wgpu & some related packages
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurBrussee committed Oct 30, 2024
1 parent 5bfff31 commit f4df2f4
Show file tree
Hide file tree
Showing 9 changed files with 454 additions and 567 deletions.
915 changes: 399 additions & 516 deletions Cargo.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ criterion = { version = "0.5.1", default-features = false }
dify = { version = "0.7", default-features = false }
document-features = " 0.2.8"
glow = "0.14"
glutin = "0.32.0"
glutin = "0.32.1"
glutin-winit = "0.5.0"
home = "0.5.9"
image = { version = "0.25", default-features = false }
kittest = { git = "https://github.com/rerun-io/kittest", version = "0.1", branch = "main"}
kittest = { git = "https://github.com/rerun-io/kittest", version = "0.1", branch = "main" }
log = { version = "0.4", features = ["std"] }
nohash-hasher = "0.2"
parking_lot = "0.12"
Expand All @@ -97,8 +97,8 @@ web-time = "1.1.0" # Timekeeping for native and web
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
web-sys = "0.3.70"
wgpu = { version = "22.1.0", default-features = false }
windows-sys = "0.52"
wgpu = { version = "23.0.0", default-features = false }
windows-sys = "0.59"
winit = { version = "0.30.5", default-features = false }

[workspace.lints.rust]
Expand Down
31 changes: 16 additions & 15 deletions crates/eframe/src/native/file_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,25 +58,26 @@ fn roaming_appdata() -> Option<PathBuf> {
extern "C" {
fn wcslen(buf: *const u16) -> usize;
}

let mut path = ptr::null_mut();

// Safety: FFI call, windows-sys upholds invariants.
unsafe {
let mut path = ptr::null_mut();
match SHGetKnownFolderPath(
if SHGetKnownFolderPath(
&FOLDERID_RoamingAppData,
KF_FLAG_DONT_VERIFY as u32,
0,
std::ptr::null_mut(),
&mut path,
) {
S_OK => {
let path_slice = slice::from_raw_parts(path, wcslen(path));
let s = OsString::from_wide(&path_slice);
CoTaskMemFree(path.cast());
Some(PathBuf::from(s))
}
_ => {
// Free any allocated memory even on failure. A null ptr is a no-op for `CoTaskMemFree`.
CoTaskMemFree(path.cast());
None
}
) == S_OK
{
let path_slice = slice::from_raw_parts(path, wcslen(path));
let s = OsString::from_wide(path_slice);
CoTaskMemFree(path.cast());
Some(PathBuf::from(s))
} else {
// Free any allocated memory even on failure. A null ptr is a no-op for `CoTaskMemFree`.
CoTaskMemFree(path.cast());
None
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions crates/egui-wgpu/src/renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ impl Renderer {
label: Some("egui_pipeline"),
layout: Some(&pipeline_layout),
vertex: wgpu::VertexState {
entry_point: "vs_main",
entry_point: Some("vs_main"),
module: &module,
buffers: &[wgpu::VertexBufferLayout {
array_stride: 5 * 4,
Expand Down Expand Up @@ -345,9 +345,9 @@ impl Renderer {
module: &module,
entry_point: if output_color_format.is_srgb() {
log::warn!("Detected a linear (sRGBA aware) framebuffer {:?}. egui prefers Rgba8Unorm or Bgra8Unorm", output_color_format);
"fs_main_linear_framebuffer"
Some("fs_main_linear_framebuffer")
} else {
"fs_main_gamma_framebuffer" // this is what we prefer
Some("fs_main_gamma_framebuffer") // this is what we prefer
},
targets: &[Some(wgpu::ColorTargetState {
format: output_color_format,
Expand Down
2 changes: 1 addition & 1 deletion crates/egui-winit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ winit = { workspace = true, default-features = false }
#! ### Optional dependencies

# feature accesskit
accesskit_winit = { version = "0.22", optional = true }
accesskit_winit = { version = "0.22.4", optional = true }

## Enable this when generating docs.
document-features = { workspace = true, optional = true }
Expand Down
11 changes: 8 additions & 3 deletions crates/egui_demo_app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ web_app = ["http", "persistence"]

http = ["ehttp", "image", "poll-promise", "egui_extras/image"]
image_viewer = ["image", "egui_extras/all_loaders", "rfd"]
persistence = ["eframe/persistence", "egui/persistence", "serde", "egui_extras/serde"]
persistence = [
"eframe/persistence",
"egui/persistence",
"serde",
"egui_extras/serde",
]
puffin = ["eframe/puffin", "dep:puffin", "dep:puffin_http"]
serde = ["dep:serde", "egui_demo_lib/serde", "egui/serde"]
syntect = ["egui_demo_lib/syntect"]
Expand All @@ -38,7 +43,7 @@ wayland = ["eframe/wayland"]
x11 = ["eframe/x11"]

[dependencies]
chrono = { version = "0.4", default-features = false, features = [
chrono = { version = "0.4.38", default-features = false, features = [
"js-sys",
"wasmbind",
] }
Expand Down Expand Up @@ -78,6 +83,6 @@ rfd = { version = "0.13", optional = true }

# web:
[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen = "=0.2.93"
wasm-bindgen = "=0.2.95"
wasm-bindgen-futures.workspace = true
web-sys.workspace = true
15 changes: 9 additions & 6 deletions crates/egui_demo_lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ repository = "https://github.com/emilk/egui/tree/master/crates/egui_demo_lib"
categories = ["gui", "graphics"]
keywords = ["glium", "egui", "gui", "gamedev"]
include = [
"../LICENSE-APACHE",
"../LICENSE-MIT",
"**/*.rs",
"Cargo.toml",
"data/icon.png",
"../LICENSE-APACHE",
"../LICENSE-MIT",
"**/*.rs",
"Cargo.toml",
"data/icon.png",
]

[lints]
Expand Down Expand Up @@ -48,7 +48,10 @@ egui_extras = { workspace = true, features = ["default"] }
unicode_names2 = { version = "0.6.0", default-features = false } # this old version has fewer dependencies

#! ### Optional dependencies
chrono = { version = "0.4", optional = true, features = ["js-sys", "wasmbind"] }
chrono = { version = "0.4.38", optional = true, features = [
"js-sys",
"wasmbind",
] }
## Enable this when generating docs.
document-features = { workspace = true, optional = true }
serde = { workspace = true, optional = true }
Expand Down
18 changes: 9 additions & 9 deletions crates/egui_extras/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
name = "egui_extras"
version.workspace = true
authors = [
"Dominik Rössler <dominik@freshx.de>",
"Emil Ernerfeldt <emil.ernerfeldt@gmail.com>",
"René Rössler <rene@freshx.de>",
"Dominik Rössler <dominik@freshx.de>",
"Emil Ernerfeldt <emil.ernerfeldt@gmail.com>",
"René Rössler <rene@freshx.de>",
]
description = "Extra functionality and widgets for the egui GUI library"
edition.workspace = true
Expand Down Expand Up @@ -82,10 +82,10 @@ serde = { workspace = true, optional = true }

# Date operations needed for datepicker widget
chrono = { version = "0.4", optional = true, default-features = false, features = [
"clock",
"js-sys",
"std",
"wasmbind",
"clock",
"js-sys",
"std",
"wasmbind",
] }

## Enable this when generating docs.
Expand All @@ -98,8 +98,8 @@ mime_guess2 = { version = "2", optional = true, default-features = false }

puffin = { workspace = true, optional = true }

syntect = { version = "5", optional = true, default-features = false, features = [
"default-fancy",
syntect = { version = "5.2", optional = true, default-features = false, features = [
"default-fancy",
] }

# svg feature
Expand Down
15 changes: 5 additions & 10 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,9 @@ all-features = true
[advisories]
version = 2
ignore = [
"RUSTSEC-2024-0320", # unmaintaines yaml-rust pulled in by syntect
{ name = "async-process" }, # yanked crated pulled in by old accesskit
"RUSTSEC-2024-0320", # unmaintaines yaml-rust pulled in by syntect
]


[bans]
multiple-versions = "deny"
wildcards = "deny"
Expand All @@ -46,20 +44,18 @@ deny = [
]

skip = [
{ name = "bit-set" }, # wgpu's naga depends on 0.6, syntect's (used by egui_extras) fancy-regex depends on 0.5
{ name = "bit-set" }, # wgpu's naga depends on 0.8, syntect's (used by egui_extras) fancy-regex depends on 0.5
{ name = "bit-vec" }, # dependency of bit-set in turn, different between 0.6 and 0.5
{ name = "bitflags" }, # old 1.0 version via glutin, png, spirv, …
{ name = "cfg_aliases" }, # old version via wgpu
{ name = "event-listener" }, # TODO(emilk): rustls pulls in two versions of this 😭
{ name = "futures-lite" }, # old version via accesskit_unix and zbus
{ name = "memoffset" }, # tiny dependency
{ name = "ndk-sys" }, # old version via wgpu, winit uses newer version
{ name = "quick-xml" }, # old version via wayland-scanner
{ name = "redox_syscall" }, # old version via winit
{ name = "time" }, # old version pulled in by unmaintianed crate 'chrono'
{ name = "windows-core" }, # old version via accesskit_windows
{ name = "windows" }, # old version via accesskit_windows
{ name = "glow" }, # wgpu uses an old `glow`, but realistically no one uses _both_ `egui_wgpu` and `egui_glow`, so we won't get a duplicate dependency
{ name = "windows-core" }, # Chrono pulls in v0.51, accesskit uses v0.58.0
{ name = "windows-sys" }, # glutin pulls in v0.52.0, accesskit pulls in v0.59.0
]
skip-tree = [
{ name = "criterion" }, # dev-dependency
Expand All @@ -84,7 +80,6 @@ allow = [
"CC0-1.0", # https://creativecommons.org/publicdomain/zero/1.0/
"ISC", # https://www.tldrlegal.com/license/isc-license
"LicenseRef-UFL-1.0", # no official SPDX, see https://github.com/emilk/egui/issues/2321
"MIT-0", # https://choosealicense.com/licenses/mit-0/
"MIT", # https://tldrlegal.com/license/mit-license
"MPL-2.0", # https://www.mozilla.org/en-US/MPL/2.0/FAQ/ - see Q11. Used by webpki-roots on Linux.
"OFL-1.1", # https://spdx.org/licenses/OFL-1.1.html
Expand All @@ -110,5 +105,5 @@ unknown-registry = "deny"
unknown-git = "deny"

allow-git = [
"https://github.com/rerun-io/kittest", # TODO(lucasmerlin): remove this once the kittest crate is published"
"https://github.com/rerun-io/kittest", # TODO(lucasmerlin): remove this once the kittest crate is published"
]

0 comments on commit f4df2f4

Please sign in to comment.