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

Update egui to latest, update wgpu to 23.0.0 #8183

Merged
merged 2 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
255 changes: 82 additions & 173 deletions Cargo.lock

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
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 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
Loading