diff --git a/Cargo.lock b/Cargo.lock index beb1006fb8ad..e893f5b1d848 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1948,7 +1948,7 @@ checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "ecolor" version = "0.30.0" -source = "git+https://github.com/emilk/egui.git?rev=938d8b0d2e2a551ac354d76d6208188e5942b21e#938d8b0d2e2a551ac354d76d6208188e5942b21e" +source = "git+https://github.com/emilk/egui.git?rev=f0d7c74e838b8e8920a22e7515990fbe057ec218#f0d7c74e838b8e8920a22e7515990fbe057ec218" dependencies = [ "bytemuck", "color-hex", @@ -1965,7 +1965,7 @@ checksum = "18aade80d5e09429040243ce1143ddc08a92d7a22820ac512610410a4dd5214f" [[package]] name = "eframe" version = "0.30.0" -source = "git+https://github.com/emilk/egui.git?rev=938d8b0d2e2a551ac354d76d6208188e5942b21e#938d8b0d2e2a551ac354d76d6208188e5942b21e" +source = "git+https://github.com/emilk/egui.git?rev=f0d7c74e838b8e8920a22e7515990fbe057ec218#f0d7c74e838b8e8920a22e7515990fbe057ec218" dependencies = [ "ahash", "bytemuck", @@ -2004,11 +2004,12 @@ dependencies = [ [[package]] name = "egui" version = "0.30.0" -source = "git+https://github.com/emilk/egui.git?rev=938d8b0d2e2a551ac354d76d6208188e5942b21e#938d8b0d2e2a551ac354d76d6208188e5942b21e" +source = "git+https://github.com/emilk/egui.git?rev=f0d7c74e838b8e8920a22e7515990fbe057ec218#f0d7c74e838b8e8920a22e7515990fbe057ec218" dependencies = [ "accesskit", "ahash", "backtrace", + "bitflags 2.6.0", "emath", "epaint", "log", @@ -2021,7 +2022,7 @@ dependencies = [ [[package]] name = "egui-wgpu" version = "0.30.0" -source = "git+https://github.com/emilk/egui.git?rev=938d8b0d2e2a551ac354d76d6208188e5942b21e#938d8b0d2e2a551ac354d76d6208188e5942b21e" +source = "git+https://github.com/emilk/egui.git?rev=f0d7c74e838b8e8920a22e7515990fbe057ec218#f0d7c74e838b8e8920a22e7515990fbe057ec218" dependencies = [ "ahash", "bytemuck", @@ -2040,7 +2041,7 @@ dependencies = [ [[package]] name = "egui-winit" version = "0.30.0" -source = "git+https://github.com/emilk/egui.git?rev=938d8b0d2e2a551ac354d76d6208188e5942b21e#938d8b0d2e2a551ac354d76d6208188e5942b21e" +source = "git+https://github.com/emilk/egui.git?rev=f0d7c74e838b8e8920a22e7515990fbe057ec218#f0d7c74e838b8e8920a22e7515990fbe057ec218" dependencies = [ "accesskit_winit", "ahash", @@ -2081,7 +2082,7 @@ dependencies = [ [[package]] name = "egui_extras" version = "0.30.0" -source = "git+https://github.com/emilk/egui.git?rev=938d8b0d2e2a551ac354d76d6208188e5942b21e#938d8b0d2e2a551ac354d76d6208188e5942b21e" +source = "git+https://github.com/emilk/egui.git?rev=f0d7c74e838b8e8920a22e7515990fbe057ec218#f0d7c74e838b8e8920a22e7515990fbe057ec218" dependencies = [ "ahash", "egui", @@ -2098,7 +2099,7 @@ dependencies = [ [[package]] name = "egui_glow" version = "0.30.0" -source = "git+https://github.com/emilk/egui.git?rev=938d8b0d2e2a551ac354d76d6208188e5942b21e#938d8b0d2e2a551ac354d76d6208188e5942b21e" +source = "git+https://github.com/emilk/egui.git?rev=f0d7c74e838b8e8920a22e7515990fbe057ec218#f0d7c74e838b8e8920a22e7515990fbe057ec218" dependencies = [ "ahash", "bytemuck", @@ -2115,7 +2116,7 @@ dependencies = [ [[package]] name = "egui_kittest" version = "0.30.0" -source = "git+https://github.com/emilk/egui.git?rev=938d8b0d2e2a551ac354d76d6208188e5942b21e#938d8b0d2e2a551ac354d76d6208188e5942b21e" +source = "git+https://github.com/emilk/egui.git?rev=f0d7c74e838b8e8920a22e7515990fbe057ec218#f0d7c74e838b8e8920a22e7515990fbe057ec218" dependencies = [ "dify", "eframe", @@ -2124,12 +2125,13 @@ dependencies = [ "image", "kittest", "pollster 0.4.0", + "wgpu", ] [[package]] name = "egui_plot" version = "0.30.0" -source = "git+https://github.com/emilk/egui_plot.git?rev=4a16b8842aa39e6ea6b6c9c98afe20e060e767b6#4a16b8842aa39e6ea6b6c9c98afe20e060e767b6" +source = "git+https://github.com/emilk/egui_plot.git?rev=80e2199a2e121db288fe6b0099d91c35acc75a7c#80e2199a2e121db288fe6b0099d91c35acc75a7c" dependencies = [ "ahash", "egui", @@ -2185,7 +2187,7 @@ checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "emath" version = "0.30.0" -source = "git+https://github.com/emilk/egui.git?rev=938d8b0d2e2a551ac354d76d6208188e5942b21e#938d8b0d2e2a551ac354d76d6208188e5942b21e" +source = "git+https://github.com/emilk/egui.git?rev=f0d7c74e838b8e8920a22e7515990fbe057ec218#f0d7c74e838b8e8920a22e7515990fbe057ec218" dependencies = [ "bytemuck", "serde", @@ -2301,7 +2303,7 @@ dependencies = [ [[package]] name = "epaint" version = "0.30.0" -source = "git+https://github.com/emilk/egui.git?rev=938d8b0d2e2a551ac354d76d6208188e5942b21e#938d8b0d2e2a551ac354d76d6208188e5942b21e" +source = "git+https://github.com/emilk/egui.git?rev=f0d7c74e838b8e8920a22e7515990fbe057ec218#f0d7c74e838b8e8920a22e7515990fbe057ec218" dependencies = [ "ab_glyph", "ahash", @@ -2320,7 +2322,7 @@ dependencies = [ [[package]] name = "epaint_default_fonts" version = "0.30.0" -source = "git+https://github.com/emilk/egui.git?rev=938d8b0d2e2a551ac354d76d6208188e5942b21e#938d8b0d2e2a551ac354d76d6208188e5942b21e" +source = "git+https://github.com/emilk/egui.git?rev=f0d7c74e838b8e8920a22e7515990fbe057ec218#f0d7c74e838b8e8920a22e7515990fbe057ec218" [[package]] name = "equivalent" @@ -2908,6 +2910,18 @@ dependencies = [ "bitflags 2.6.0", ] +[[package]] +name = "gpu-allocator" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c151a2a5ef800297b4e79efa4f4bec035c5f51d5ae587287c9b952bdf734cacd" +dependencies = [ + "log", + "presser", + "thiserror 1.0.65", + "windows 0.58.0", +] + [[package]] name = "gpu-descriptor" version = "0.3.0" @@ -5118,6 +5132,12 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "presser" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa" + [[package]] name = "prettyplease" version = "0.2.25" @@ -5462,6 +5482,12 @@ dependencies = [ "rand", ] +[[package]] +name = "range-alloc" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8a99fddc9f0ba0a85884b8d14e3592853e787d581ca1816c91349b10e4eeab" + [[package]] name = "raw-cpuid" version = "11.2.0" @@ -9723,6 +9749,7 @@ dependencies = [ "android_system_properties", "arrayvec", "ash", + "bit-set", "bitflags 2.6.0", "block", "bytemuck", @@ -9731,6 +9758,7 @@ dependencies = [ "glow 0.14.2", "glutin_wgl_sys", "gpu-alloc", + "gpu-allocator", "gpu-descriptor", "js-sys", "khronos-egl", @@ -9744,6 +9772,7 @@ dependencies = [ "once_cell", "parking_lot", "profiling", + "range-alloc", "raw-window-handle", "renderdoc-sys", "rustc-hash 1.1.0", @@ -9753,6 +9782,7 @@ dependencies = [ "web-sys", "wgpu-types", "windows 0.58.0", + "windows-core 0.58.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 6b8eee119203..9204cf38d8c4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -559,13 +559,13 @@ 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 = "938d8b0d2e2a551ac354d76d6208188e5942b21e" } # egui master 2025-01-03 -eframe = { git = "https://github.com/emilk/egui.git", rev = "938d8b0d2e2a551ac354d76d6208188e5942b21e" } # egui master 2025-01-03 -egui = { git = "https://github.com/emilk/egui.git", rev = "938d8b0d2e2a551ac354d76d6208188e5942b21e" } # egui master 2025-01-03 -egui_extras = { git = "https://github.com/emilk/egui.git", rev = "938d8b0d2e2a551ac354d76d6208188e5942b21e" } # egui master 2025-01-03 -egui_kittest = { git = "https://github.com/emilk/egui.git", rev = "938d8b0d2e2a551ac354d76d6208188e5942b21e" } # egui master 2025-01-03 -egui-wgpu = { git = "https://github.com/emilk/egui.git", rev = "938d8b0d2e2a551ac354d76d6208188e5942b21e" } # egui master 2025-01-03 -emath = { git = "https://github.com/emilk/egui.git", rev = "938d8b0d2e2a551ac354d76d6208188e5942b21e" } # egui master 2025-01-03 +ecolor = { git = "https://github.com/emilk/egui.git", rev = "f0d7c74e838b8e8920a22e7515990fbe057ec218" } # egui master 2025-01-08 +eframe = { git = "https://github.com/emilk/egui.git", rev = "f0d7c74e838b8e8920a22e7515990fbe057ec218" } # egui master 2025-01-08 +egui = { git = "https://github.com/emilk/egui.git", rev = "f0d7c74e838b8e8920a22e7515990fbe057ec218" } # egui master 2025-01-08 +egui_extras = { git = "https://github.com/emilk/egui.git", rev = "f0d7c74e838b8e8920a22e7515990fbe057ec218" } # egui master 2025-01-08 +egui_kittest = { git = "https://github.com/emilk/egui.git", rev = "f0d7c74e838b8e8920a22e7515990fbe057ec218" } # egui master 2025-01-08 +egui-wgpu = { git = "https://github.com/emilk/egui.git", rev = "f0d7c74e838b8e8920a22e7515990fbe057ec218" } # egui master 2025-01-08 +emath = { git = "https://github.com/emilk/egui.git", rev = "f0d7c74e838b8e8920a22e7515990fbe057ec218" } # egui master 2025-01-08 # Useful while developing: # ecolor = { path = "../../egui/crates/ecolor" } @@ -576,7 +576,7 @@ emath = { git = "https://github.com/emilk/egui.git", rev = "938d8b0d2e2a551ac354 # egui-wgpu = { path = "../../egui/crates/egui-wgpu" } # emath = { path = "../../egui/crates/emath" } -egui_plot = { git = "https://github.com/emilk/egui_plot.git", rev = "4a16b8842aa39e6ea6b6c9c98afe20e060e767b6" } +egui_plot = { git = "https://github.com/emilk/egui_plot.git", rev = "80e2199a2e121db288fe6b0099d91c35acc75a7c" } # egui_plot = { path = "../../egui_plot/egui_plot" } # egui_tiles = { git = "https://github.com/rerun-io/egui_tiles", rev = "48e0ef566479000a23d8dabf84badced98f1b9a6" } # https://github.com/rerun-io/egui_tiles/pull/89 2024-11-19 diff --git a/crates/top/rerun/src/commands/entrypoint.rs b/crates/top/rerun/src/commands/entrypoint.rs index a5130511759d..47d95dd566db 100644 --- a/crates/top/rerun/src/commands/entrypoint.rs +++ b/crates/top/rerun/src/commands/entrypoint.rs @@ -857,7 +857,7 @@ fn run_impl( } Box::new(app) }), - args.renderer, + args.renderer.as_deref(), ) .map_err(|err| err.into()); diff --git a/crates/viewer/re_component_ui/src/marker_shape.rs b/crates/viewer/re_component_ui/src/marker_shape.rs index 92ceaa4245e4..955f0ff2fe4e 100644 --- a/crates/viewer/re_component_ui/src/marker_shape.rs +++ b/crates/viewer/re_component_ui/src/marker_shape.rs @@ -39,7 +39,7 @@ pub(crate) fn edit_marker_shape_ui( if response.clicked() { *edit_marker = marker; - response.changed = true; + response.mark_changed(); } combined_response = Some(match combined_response { diff --git a/crates/viewer/re_renderer/src/config.rs b/crates/viewer/re_renderer/src/config.rs index c2b8c4aa8071..9d539c580af9 100644 --- a/crates/viewer/re_renderer/src/config.rs +++ b/crates/viewer/re_renderer/src/config.rs @@ -61,7 +61,25 @@ impl DeviceTier { flags: match self { Self::Gles => wgpu::DownlevelFlags::empty(), // Require fully WebGPU compliance for the native tier. - Self::FullWebGpuSupport => wgpu::DownlevelFlags::all(), + Self::FullWebGpuSupport => { + // Turn a blind eye on a few features that are missing as of writing in WSL even with latest Vulkan drivers. + // Pretend we still have full WebGPU support anyways. + wgpu::DownlevelFlags::compliant() + // Lacking `SURFACE_VIEW_FORMATS` means we can't set the format of views on surface textures + // (the result of `get_current_texture`). + // And the surface won't tell us which formats are supported. + // We avoid doing anything wonky with surfaces anyways, so we won't hit this. + .intersection(wgpu::DownlevelFlags::SURFACE_VIEW_FORMATS.complement()) + // Lacking `FULL_DRAW_INDEX_UINT32` means that vertex indices above 2^24-1 are invalid. + // I.e. we can only draw with about 16.8mio vertices per mesh. + // Typically we don't reach this limit. + // + // This can happen if… + // * OpenGL: `GL_MAX_ELEMENT_INDEX` reports a value lower than `std::u32::MAX` + // * Vulkan: `VkPhysicalDeviceLimits::fullDrawIndexUint32` is false. + // The consequence of exceeding this limit seems to be undefined. + .intersection(wgpu::DownlevelFlags::FULL_DRAW_INDEX_UINT32.complement()) + } }, limits: Default::default(), // unused so far both here and in wgpu as of writing. @@ -84,6 +102,7 @@ impl DeviceTier { downlevel_caps: &wgpu::DownlevelCapabilities, ) -> Result<(), InsufficientDeviceCapabilities> { let required_downlevel_caps_webgpu = self.required_downlevel_capabilities(); + if downlevel_caps.shader_model < required_downlevel_caps_webgpu.shader_model { Err(InsufficientDeviceCapabilities::TooLowShaderModel { required: required_downlevel_caps_webgpu.shader_model, @@ -296,6 +315,47 @@ impl DeviceCaps { } } +pub fn instance_descriptor(force_backend: Option<&str>) -> wgpu::InstanceDescriptor { + let backends = if let Some(force_backend) = force_backend { + if let Some(backend) = parse_graphics_backend(force_backend) { + if let Err(err) = validate_graphics_backend_applicability(backend) { + re_log::error!("Failed to force rendering backend parsed from {force_backend:?}: {err}\nUsing default backend instead."); + supported_backends() + } else { + re_log::info!("Forcing graphics backend to {backend:?}."); + backend.into() + } + } else { + re_log::error!("Failed to parse rendering backend string {force_backend:?}. Using default backend instead."); + supported_backends() + } + } else { + supported_backends() + }; + + wgpu::InstanceDescriptor { + backends, + + flags: wgpu::InstanceFlags::default() + // Allow adapters that aren't compliant with the backend they're implementing. + // A concrete example of this is the latest Vulkan drivers on WSL which (as of writing) + // advertise themselves as not being Vulkan compliant but work fine for the most part. + // + // In the future we might consider enabling this _only_ for WSL as this might otherwise + // cause us to run with arbitrary development versions of drivers. + // (then again, if a user has such a driver they likely *want* us to run with it anyways!) + .union(wgpu::InstanceFlags::ALLOW_UNDERLYING_NONCOMPLIANT_ADAPTER) + // Allow manipulation via environment variables. + .with_env(), + + // FXC isn't great (slow & outdated), but DXC is painful to ship as it has to be provided separately. + // (Note though that we generally prefer running with Vulkan) + dx12_shader_compiler: wgpu::Dx12Compiler::Fxc, + + gles_minor_version: wgpu::Gles3MinorVersion::Automatic, + } +} + /// Backends that are officially supported by `re_renderer`. /// /// Other backend might work as well, but lack of support isn't regarded as a bug. diff --git a/crates/viewer/re_renderer/src/context.rs b/crates/viewer/re_renderer/src/context.rs index 3608a4a625f5..1a955c599826 100644 --- a/crates/viewer/re_renderer/src/context.rs +++ b/crates/viewer/re_renderer/src/context.rs @@ -23,7 +23,8 @@ const STARTUP_FRAME_IDX: u64 = u64::MAX; #[derive(thiserror::Error, Debug)] pub enum RenderContextError { #[error( - "The GPU/graphics driver is lacking some abilities: {0}.\nConsider updating the driver." + "The GPU/graphics driver is lacking some abilities: {0}. \ + Check the troubleshooting guide at https://rerun.io/docs/getting-started/troubleshooting and consider updating your graphics driver." )] InsufficientDeviceCapabilities(#[from] crate::config::InsufficientDeviceCapabilities), } diff --git a/crates/viewer/re_renderer_examples/framework.rs b/crates/viewer/re_renderer_examples/framework.rs index 7313834f9431..9cfe737837e5 100644 --- a/crates/viewer/re_renderer_examples/framework.rs +++ b/crates/viewer/re_renderer_examples/framework.rs @@ -7,11 +7,7 @@ use std::sync::Arc; use anyhow::Context as _; use web_time::Instant; -use re_renderer::{ - config::{supported_backends, DeviceCaps}, - view_builder::ViewBuilder, - RenderContext, -}; +use re_renderer::{config::DeviceCaps, view_builder::ViewBuilder, RenderContext}; use winit::{ application::ApplicationHandler, @@ -112,14 +108,12 @@ fn preferred_framebuffer_format(formats: &[wgpu::TextureFormat]) -> wgpu::Textur impl Application { async fn new(window: Window) -> anyhow::Result { let window = Arc::new(window); - let instance = wgpu::Instance::new(wgpu::InstanceDescriptor { - backends: supported_backends(), - flags: wgpu::InstanceFlags::default() - // Run without validation layers, they can be annoying on shader reload depending on the backend. - .intersection(wgpu::InstanceFlags::VALIDATION.complement()), - dx12_shader_compiler: wgpu::Dx12Compiler::Fxc, - gles_minor_version: wgpu::Gles3MinorVersion::Automatic, - }); + + let mut instance_desc = re_renderer::config::instance_descriptor(None); + // Run without validation layers, they can be annoying on shader reload depending on the backend. + instance_desc.flags.remove(wgpu::InstanceFlags::VALIDATION); + + let instance = wgpu::Instance::new(instance_desc); let surface = instance.create_surface(window.clone()).unwrap(); let adapter = instance .request_adapter(&wgpu::RequestAdapterOptions { diff --git a/crates/viewer/re_ui/examples/re_ui_example/main.rs b/crates/viewer/re_ui/examples/re_ui_example/main.rs index 6a9b3990660d..1a92bc219444 100644 --- a/crates/viewer/re_ui/examples/re_ui_example/main.rs +++ b/crates/viewer/re_ui/examples/re_ui_example/main.rs @@ -441,7 +441,7 @@ impl egui_tiles::Behavior for MyTileTreeBehavior { _tile_id: egui_tiles::TileId, _pane: &mut Tab, ) -> egui_tiles::UiResponse { - egui::Frame::none().inner_margin(4.0).show(ui, |ui| { + egui::Frame::new().inner_margin(4.0).show(ui, |ui| { egui::warn_if_debug_build(ui); ui.label("Hover me for a tooltip") .on_hover_text("This is a tooltip"); diff --git a/crates/viewer/re_ui/src/list_item/list_item.rs b/crates/viewer/re_ui/src/list_item/list_item.rs index 3df6e741213f..c4904cddee44 100644 --- a/crates/viewer/re_ui/src/list_item/list_item.rs +++ b/crates/viewer/re_ui/src/list_item/list_item.rs @@ -332,8 +332,8 @@ impl ListItem { // override_hover should not affect the returned response let mut style_response = response.clone(); if force_hovered { - style_response.contains_pointer = true; - style_response.hovered = true; + style_response.flags |= egui::response::Flags::CONTAINS_POINTER; + style_response.flags |= egui::response::Flags::HOVERED; } let mut collapse_response = None; diff --git a/crates/viewer/re_ui/src/ui_ext.rs b/crates/viewer/re_ui/src/ui_ext.rs index 26bbdac9d926..18b3ad6cc676 100644 --- a/crates/viewer/re_ui/src/ui_ext.rs +++ b/crates/viewer/re_ui/src/ui_ext.rs @@ -25,7 +25,7 @@ fn notification_label( visible_text: &str, full_text: &str, ) -> egui::Response { - egui::Frame::none() + egui::Frame::new() .stroke((1.0, fg_color)) .fill(error_label_bg_color(fg_color)) .rounding(4.0) diff --git a/crates/viewer/re_view_dataframe/src/dataframe_ui.rs b/crates/viewer/re_view_dataframe/src/dataframe_ui.rs index c481f4d06905..79c060191eb7 100644 --- a/crates/viewer/re_view_dataframe/src/dataframe_ui.rs +++ b/crates/viewer/re_view_dataframe/src/dataframe_ui.rs @@ -85,7 +85,7 @@ pub(crate) fn dataframe_ui( .take_while(|cd| matches!(cd, ColumnDescriptor::Time(_))) .count(); - egui::Frame::none().inner_margin(5.0).show(ui, |ui| { + egui::Frame::new().inner_margin(5.0).show(ui, |ui| { egui_table::Table::new() .id_salt(table_id_salt) .columns( @@ -232,7 +232,7 @@ impl egui_table::TableDelegate for DataframeTableDelegate<'_> { ui.style_mut().wrap_mode = Some(egui::TextWrapMode::Truncate); } - egui::Frame::none() + egui::Frame::new() .inner_margin(egui::Margin::symmetric(4, 0)) .show(ui, |ui| { if cell.row_nr == 0 { @@ -456,7 +456,7 @@ impl egui_table::TableDelegate for DataframeTableDelegate<'_> { }; // Draw the cell content with some margin. - egui::Frame::none() + egui::Frame::new() .inner_margin(egui::Margin::symmetric(Self::LEFT_RIGHT_MARGIN, 0)) .show(ui, |ui| { line_ui( diff --git a/crates/viewer/re_view_map/src/map_overlays.rs b/crates/viewer/re_view_map/src/map_overlays.rs index 1f80468cf8d0..3ef24fd6ad6d 100644 --- a/crates/viewer/re_view_map/src/map_overlays.rs +++ b/crates/viewer/re_view_map/src/map_overlays.rs @@ -15,7 +15,7 @@ pub fn acknowledgement_overlay( let mut ui = ui.new_child(egui::UiBuilder::new().max_rect(rect)); ui.multiply_opacity(0.7); - egui::Frame::none() + egui::Frame::new() .fill(ui.visuals().window_fill) .inner_margin(egui::Margin::same(2)) .show(&mut ui, |ui| { diff --git a/crates/viewer/re_viewer/src/app_state.rs b/crates/viewer/re_viewer/src/app_state.rs index c07979efb739..52407fb232d4 100644 --- a/crates/viewer/re_viewer/src/app_state.rs +++ b/crates/viewer/re_viewer/src/app_state.rs @@ -467,7 +467,7 @@ impl AppState { let min_height_each = 90.0_f32.at_most(ui.available_height() / 2.0); egui::TopBottomPanel::top("recording_panel") - .frame(egui::Frame::none()) + .frame(egui::Frame::new()) .resizable(resizable) .show_separator_line(false) .min_height(min_height_each) diff --git a/crates/viewer/re_viewer/src/lib.rs b/crates/viewer/re_viewer/src/lib.rs index 70875688acd8..acee4e585132 100644 --- a/crates/viewer/re_viewer/src/lib.rs +++ b/crates/viewer/re_viewer/src/lib.rs @@ -153,27 +153,7 @@ impl AppEnvironment { // --------------------------------------------------------------------------- -fn supported_graphics_backends(force_wgpu_backend: Option) -> wgpu::Backends { - if let Some(force_wgpu_backend) = force_wgpu_backend { - if let Some(backend) = re_renderer::config::parse_graphics_backend(&force_wgpu_backend) { - if let Err(err) = re_renderer::config::validate_graphics_backend_applicability(backend) - { - re_log::error!("Failed to force rendering backend parsed from {force_wgpu_backend:?}: {err}\nUsing default backend instead."); - re_renderer::config::supported_backends() - } else { - re_log::info!("Forcing graphics backend to {backend:?}."); - backend.into() - } - } else { - re_log::error!("Failed to parse rendering backend string {force_wgpu_backend:?}. Using default backend instead."); - re_renderer::config::supported_backends() - } - } else { - re_renderer::config::supported_backends() - } -} - -pub(crate) fn wgpu_options(force_wgpu_backend: Option) -> egui_wgpu::WgpuConfiguration { +pub(crate) fn wgpu_options(force_wgpu_backend: Option<&str>) -> egui_wgpu::WgpuConfiguration { re_tracing::profile_function!(); egui_wgpu::WgpuConfiguration { @@ -195,22 +175,19 @@ pub(crate) fn wgpu_options(force_wgpu_backend: Option) -> egui_wgpu::Wgp egui_wgpu::SurfaceErrorAction::SkipFrame } }), - // TODO(#8475): It would be great to use `egui_wgpu::WgpuSetup::Existing` and put the - // full control of adapter creation into the hands of `re_renderer`. - // However, we generally need to take into account the _surface_ as well: - // * this is a strict *requirement* when using WebGL - // * on OpenGL & Linux it _helps_ to know the surface because either Vulkan or OpenGL may not be happy with all surfaces - // - // Next better thing that we should aspire for is to allow rejecting adapters on native in egui. - // I.e. instead of always providing a device descriptor, we should allow it to fail for a given device. - // This rejection should happen with reason-message so it's tractable why a given adapter wasn't chosen. - // Which is obviously what we want to show when we're rejecting all adapters, but it would - // also be great to be able to show that information later on. - wgpu_setup: egui_wgpu::WgpuSetup::CreateNew { + + wgpu_setup: egui_wgpu::WgpuSetup::CreateNew(egui_wgpu::WgpuSetupCreateNew { + instance_descriptor: re_renderer::config::instance_descriptor(force_wgpu_backend), + + // TODO(#8475): Install custom native adapter selector with more extensive logging and the ability to pick adapter by name + // (user may e.g. request "nvidia" or "intel" and it should just work!) + // ideally producing structured reasoning of why which one was picked in the process. + // This should live in re_renderer::config so that we can reuse it in tests & re_renderer examples. + native_adapter_selector: None, device_descriptor: std::sync::Arc::new(|adapter| re_renderer::config::DeviceCaps::from_adapter_without_validation(adapter).device_descriptor()), - supported_backends: supported_graphics_backends(force_wgpu_backend), - power_preference: wgpu::util::power_preference_from_env().unwrap_or(wgpu::PowerPreference::HighPerformance), - }, + + ..Default::default() + }), ..Default::default() } } diff --git a/crates/viewer/re_viewer/src/native.rs b/crates/viewer/re_viewer/src/native.rs index 5d48f24cbe39..e17b23cc3844 100644 --- a/crates/viewer/re_viewer/src/native.rs +++ b/crates/viewer/re_viewer/src/native.rs @@ -11,7 +11,7 @@ pub fn run_native_app( // `eframe::run_native` may only be called on the main thread. _: crate::MainThreadToken, app_creator: AppCreator, - force_wgpu_backend: Option, + force_wgpu_backend: Option<&str>, ) -> eframe::Result { let native_options = eframe_options(force_wgpu_backend); @@ -26,7 +26,7 @@ pub fn run_native_app( ) } -pub fn eframe_options(force_wgpu_backend: Option) -> eframe::NativeOptions { +pub fn eframe_options(force_wgpu_backend: Option<&str>) -> eframe::NativeOptions { re_tracing::profile_function!(); eframe::NativeOptions { viewport: egui::ViewportBuilder::default() @@ -111,6 +111,6 @@ pub fn run_native_viewer_with_messages( app.add_receiver(rx); Box::new(app) }), - force_wgpu_backend, + force_wgpu_backend.as_deref(), ) } diff --git a/crates/viewer/re_viewer/src/web.rs b/crates/viewer/re_viewer/src/web.rs index 8d5ade891bfe..45d4b595cb6c 100644 --- a/crates/viewer/re_viewer/src/web.rs +++ b/crates/viewer/re_viewer/src/web.rs @@ -72,7 +72,7 @@ impl WebHandle { let app_options = self.app_options.clone(); let web_options = eframe::WebOptions { - wgpu_options: crate::wgpu_options(app_options.render_backend.clone()), + wgpu_options: crate::wgpu_options(app_options.render_backend.as_deref()), depth_buffer: 0, dithering: true, ..Default::default() diff --git a/docs/content/getting-started/troubleshooting.md b/docs/content/getting-started/troubleshooting.md index e78bed9360e0..0b746c0beffc 100644 --- a/docs/content/getting-started/troubleshooting.md +++ b/docs/content/getting-started/troubleshooting.md @@ -41,28 +41,30 @@ sudo dnf install \ pkg-config ``` -### WSL2 +[TODO(#1250)](https://github.com/rerun-io/rerun/issues/1250): Running with the wayland window manager +sometimes causes Rerun to crash. Try unsetting the wayland display (`unset WAYLAND_DISPLAY` or `WAYLAND_DISPLAY= `) as a workaround. -In addition to the above packages for Linux, you also need to run: +## Running on WSL2 (Ubuntu) +WSL's graphics drivers won't work out of the box and you'll have to update to a more recent version. +To install the latest stable version of the mesa Vulkan drivers run: ```sh -sudo apt-get -y install \ - libvulkan1 \ - libxcb-randr0 \ - mesa-vulkan-drivers \ - adwaita-icon-theme-full +sudo add-apt-repository ppa:kisak/kisak-mesa +sudo apt-get update +sudo apt-get install -y mesa-vulkan-drivers ``` -[TODO(#1250)](https://github.com/rerun-io/rerun/issues/1250): Running with the wayland window manager -sometimes causes Rerun to crash. Try unsetting the wayland display (`unset WAYLAND_DISPLAY` or `WAYLAND_DISPLAY= `) as a workaround. - -If you have a multi-gpu setup, Mesa may only report the integrated GPU such that Rerun can't pick the dedicated graphics card. -To mitigate that set `export MESA_D3D12_DEFAULT_ADAPTER_NAME=NVIDIA` (or `export MESA_D3D12_DEFAULT_ADAPTER_NAME=AMD` respectively for an AMD graphics card). - Since the Mesa driver on WSL dispatches to the Windows host graphics driver, it is important to keep the Windows drivers up-to-date as well. For example, [line rendering issues](https://github.com/rerun-io/rerun/issues/6749) have been observed when running from WSL with an outdated AMD driver on the Windows host. +On Ubuntu 24 [issues with Wayland](https://github.com/rerun-io/rerun/issues/6748) have been observed. +To mitigate this install `libxkbcommon-x11` +``` +sudo apt install libxkbcommon-x11-0 +``` +And unset the wayland display either by `unset WAYLAND_DISPLAY` or `WAYLAND_DISPLAY= `. + ## `pip install` issues If you see the following when running `pip install rerun-sdk` or `pip install rerun-notebook` on a supported platform: