Skip to content

Commit

Permalink
Update egui to latest, update wgpu to 23.0.0 (#8183)
Browse files Browse the repository at this point in the history
### What

Did some eyeballing on the `rerun_js/web-viewer/re_viewer.js` diff
together with @jprochazk to check for issues on wasm-bindgen update


### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using examples from latest `main` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/8183?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/8183?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [x] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!
* [x] If have noted any breaking changes to the log API in
`CHANGELOG.md` and the migration guide

- [PR Build Summary](https://build.rerun.io/pr/8183)
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

To run all checks from `main`, comment on the PR with `@rerun-bot
full-check`.

To deploy documentation changes immediately after merging this PR, add
the `deploy docs` label.
  • Loading branch information
Wumpf authored Nov 19, 2024
1 parent bb85677 commit cf4c76c
Show file tree
Hide file tree
Showing 9 changed files with 109 additions and 195 deletions.
245 changes: 74 additions & 171 deletions Cargo.lock

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ arrow2 = { package = "re_arrow2", version = "0.17" }
async-executor = "1.0"
backtrace = "0.3"
bincode = "1.3"
bit-vec = "0.7"
bit-vec = "0.8"
bitflags = { version = "2.4", features = ["bytemuck"] }
blackbox = "0.2.0"
bytemuck = { version = "1.18", features = ["extern_crate_alloc"] }
Expand Down Expand Up @@ -232,7 +232,7 @@ pico-args = "0.5"
ply-rs = { version = "0.1", default-features = false }
poll-promise = "0.3"
polling = "3.7.3"
pollster = "0.3"
pollster = "0.4"
prettyplease = "0.2"
proc-macro2 = { version = "1.0", default-features = false }
profiling = { version = "1.0.12", default-features = false }
Expand Down Expand Up @@ -300,8 +300,8 @@ walkers = "0.29"
# `crates/viewer/re_viewer/Cargo.toml`, and make sure that the build script still works.
# Do not make this an `=` dependency, because that may break Rust users’ builds when a newer
# version is released, even if they are not building the web viewer.
wasm-bindgen = "0.2.93"
wasm-bindgen-cli-support = "=0.2.93"
wasm-bindgen = "0.2.95"
wasm-bindgen-cli-support = "=0.2.95"
wasm-bindgen-futures = "0.4.33"
wayland-sys = "0.31.5"
web-sys = "0.3"
Expand All @@ -310,7 +310,7 @@ webbrowser = "1.0"
winit = { version = "0.30.5", default-features = false }
# TODO(andreas): Try to get rid of `fragile-send-sync-non-atomic-wasm`. This requires re_renderer being aware of single-thread restriction on resources.
# See also https://gpuweb.github.io/gpuweb/explainer/#multithreading-transfer (unsolved part of the Spec as of writing!)
wgpu = { version = "22.1", default-features = false, features = [
wgpu = { version = "23.0", default-features = false, features = [
# Backends (see https://docs.rs/wgpu/latest/wgpu/#feature-flags)
"webgl",
"metal",
Expand All @@ -324,8 +324,8 @@ wgpu = { version = "22.1", default-features = false, features = [
# Other:
"fragile-send-sync-non-atomic-wasm",
] }
wgpu-core = "22.1"
wgpu-types = "22.0"
wgpu-core = "23.0"
wgpu-types = "23.0"
xshell = "0.2"
zip = { version = "0.6", default-features = false } # We're stuck on 0.6 because https://crates.io/crates/protoc-prebuilt is still using 0.6

Expand Down Expand Up @@ -555,12 +555,12 @@ significant_drop_tightening = "allow" # An update of parking_lot made this trigg
# As a last resport, patch with a commit to our own repository.
# ALWAYS document what PR the commit hash is part of, or when it was merged into the upstream trunk.

# ecolor = { git = "https://github.com/emilk/egui.git", rev = "f97f85089df5e936999d5b7280e2e93e2958fac8" } # egui master 2024-09-25
# eframe = { git = "https://github.com/emilk/egui.git", rev = "f97f85089df5e936999d5b7280e2e93e2958fac8" } # egui master 2024-09-25
# egui = { git = "https://github.com/emilk/egui.git", rev = "f97f85089df5e936999d5b7280e2e93e2958fac8" } # egui master 2024-09-25
# egui_extras = { git = "https://github.com/emilk/egui.git", rev = "f97f85089df5e936999d5b7280e2e93e2958fac8" } # egui master 2024-09-25
# egui-wgpu = { git = "https://github.com/emilk/egui.git", rev = "f97f85089df5e936999d5b7280e2e93e2958fac8" } # egui master 2024-09-25
# emath = { git = "https://github.com/emilk/egui.git", rev = "f97f85089df5e936999d5b7280e2e93e2958fac8" } # egui master 2024-09-25
ecolor = { git = "https://github.com/emilk/egui.git", rev = "83a30064f4812d0029532675a5f2bf38c257ad0e" } # egui master 2024-11-19
eframe = { git = "https://github.com/emilk/egui.git", rev = "83a30064f4812d0029532675a5f2bf38c257ad0e" } # egui master 2024-11-19
egui = { git = "https://github.com/emilk/egui.git", rev = "83a30064f4812d0029532675a5f2bf38c257ad0e" } # egui master 2024-11-19
egui_extras = { git = "https://github.com/emilk/egui.git", rev = "83a30064f4812d0029532675a5f2bf38c257ad0e" } # egui master 2024-11-19
egui-wgpu = { git = "https://github.com/emilk/egui.git", rev = "83a30064f4812d0029532675a5f2bf38c257ad0e" } # egui master 2024-11-19
emath = { git = "https://github.com/emilk/egui.git", rev = "83a30064f4812d0029532675a5f2bf38c257ad0e" } # egui master 2024-11-19

# Useful while developing:
# ecolor = { path = "../../egui/crates/ecolor" }
Expand All @@ -573,8 +573,8 @@ significant_drop_tightening = "allow" # An update of parking_lot made this trigg
# egui_plot = { git = "https://github.com/emilk/egui_plot.git", rev = "1f6ae49a5f6bf43a869c215dea0d3028be8d742a" }
# egui_plot = { path = "../../egui_plot/egui_plot" }

# egui_tiles = { git = "https://github.com/rerun-io/egui_tiles", rev = "b2f5e232524deed983bcad01c05f27d0e8b89d98" } # https://github.com/rerun-io/egui_tiles/pull/78 2024-08-28
# egui_tiles = { path = "../egui_tiles" }
egui_tiles = { git = "https://github.com/rerun-io/egui_tiles", rev = "48e0ef566479000a23d8dabf84badced98f1b9a6" } # https://github.com/rerun-io/egui_tiles/pull/89 2024-11-19
#egui_tiles = { path = "../egui_tiles" }

# egui_commonmark = { git = "https://github.com/rerun-io/egui_commonmark", rev = "7a9dc755bfa351a3796274cb8ca87129b051c084" } # https://github.com/lampsitter/egui_commonmark/pull/65

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ macro_rules! try_downcast {
wgpu_core::binding_model::CreatePipelineLayoutError,
wgpu_core::binding_model::GetBindGroupLayoutError,
wgpu_core::binding_model::PushConstantUploadError,
wgpu_core::device::resource::CreateDeviceError,
wgpu_core::device::DeviceError,
wgpu_core::device::RenderPassCompatibilityError,
wgpu_core::pipeline::ColorStateError,
Expand Down Expand Up @@ -116,7 +115,6 @@ impl_trait![
wgpu_core::binding_model::CreatePipelineLayoutError,
wgpu_core::binding_model::GetBindGroupLayoutError,
wgpu_core::binding_model::PushConstantUploadError,
wgpu_core::device::resource::CreateDeviceError,
wgpu_core::device::DeviceError,
wgpu_core::device::RenderPassCompatibilityError,
wgpu_core::pipeline::ColorStateError,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ impl std::ops::Deref for GpuBindGroup {
}
}

impl<'a> From<&'a GpuBindGroup> for Option<&'a wgpu::BindGroup> {
fn from(bind_group: &'a GpuBindGroup) -> Self {
Some(&bind_group.resource.inner)
}
}

#[derive(Clone, Hash, PartialEq, Eq, Debug)]
pub enum BindGroupEntry {
DefaultTextureView(GpuTextureHandle), // TODO(andreas) what about non-default views?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,13 @@ impl RenderPipelineDesc {
layout: Some(pipeline_layout),
vertex: wgpu::VertexState {
module: vertex_shader_module,
entry_point: &self.vertex_entrypoint,
entry_point: Some(&self.vertex_entrypoint),
buffers: &buffers,
compilation_options: wgpu::PipelineCompilationOptions::default(),
},
fragment: wgpu::FragmentState {
module: fragment_shader_module,
entry_point: &self.fragment_entrypoint,
entry_point: Some(&self.fragment_entrypoint),
targets: &self.render_targets,
compilation_options: wgpu::PipelineCompilationOptions::default(),
}
Expand Down
4 changes: 3 additions & 1 deletion crates/viewer/re_ui/src/design_tokens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ impl DesignTokens {
let mut font_definitions = egui::FontDefinitions::default();
font_definitions.font_data.insert(
"Inter-Medium".into(),
egui::FontData::from_static(include_bytes!("../data/Inter-Medium.otf")),
std::sync::Arc::new(egui::FontData::from_static(include_bytes!(
"../data/Inter-Medium.otf"
))),
);
font_definitions
.families
Expand Down
4 changes: 2 additions & 2 deletions crates/viewer/re_viewer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ strum_macros.workspace = true
wasm-bindgen-futures.workspace = true
# NOTE: `rerun_js/web-viewer/build-wasm.mjs` is HIGHLY sensitive to changes in `wasm-bindgen`.
# Whenever updating `wasm-bindgen`, update this and the broader dependency specifications in
# the root `/Cargo.toml`, and make sure that the build script still works.
wasm-bindgen = "=0.2.93"
# the root `/Cargo.toml`, and make sure that the output of `pixi run js-build-base` still works.
wasm-bindgen = "=0.2.95"
web-sys = { workspace = true, features = [
"History",
"Location",
Expand Down
8 changes: 6 additions & 2 deletions crates/viewer/re_viewer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,12 @@ pub(crate) fn wgpu_options(force_wgpu_backend: Option<String>) -> egui_wgpu::Wgp
egui_wgpu::SurfaceErrorAction::SkipFrame
}
}),
supported_backends: supported_graphics_backends(force_wgpu_backend),
device_descriptor: std::sync::Arc::new(|adapter| re_renderer::config::DeviceCaps::from_adapter(adapter).device_descriptor()),
wgpu_setup: egui_wgpu::WgpuSetup::CreateNew {
device_descriptor: std::sync::Arc::new(|adapter| re_renderer::config::DeviceCaps::from_adapter(adapter).device_descriptor()),
supported_backends: supported_graphics_backends(force_wgpu_backend),
// TODO(andreas): Use ..Default::default(), please patch egui to have this
power_preference: wgpu::util::power_preference_from_env().unwrap_or(wgpu::PowerPreference::HighPerformance),
},
..Default::default()
}
}
Expand Down
1 change: 1 addition & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ skip = [
{ name = "pulldown-cmark" }, # Build-dependency via `ply-rs` (!). TODO(emilk): use a better crate for .ply parsing
{ name = "raw-window-handle" }, # Pretty small crate; some crates still on old version
{ name = "redox_syscall" }, # Plenty of versions in the wild
{ name = "pollster" }, # rfd is still on 0.3, but
]
skip-tree = [
{ name = "cargo-run-wasm" }, # Dev-tool
Expand Down

0 comments on commit cf4c76c

Please sign in to comment.