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 and wgpu #4111

Merged
merged 33 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
06c3fcd
update to wgpu 0.18
Wumpf Oct 8, 2023
08ea77a
fix formatting
Wumpf Nov 1, 2023
1eb4191
fix re_renderer examples
Wumpf Nov 1, 2023
e9ec5b4
cargo deny updates
Wumpf Nov 1, 2023
645840a
Update to latest egui master
emilk Nov 16, 2023
3d86e7a
Merge branch 'main' into andreas/wgpu-0.18
emilk Nov 16, 2023
969eeaf
Actually update to latest egui master
emilk Nov 16, 2023
3a652e1
Fix: use `rev` instead of `commit`
emilk Nov 17, 2023
f829d38
Update to latest egui master
emilk Nov 18, 2023
d9e4ebe
Update to latest egui master
emilk Nov 19, 2023
2e109ec
Fix web build
emilk Nov 19, 2023
ebd9087
Update puffin and egui
emilk Nov 19, 2023
8e56d81
Move re_log_encoding deps to workspace Cargo.toml
emilk Nov 19, 2023
fa615de
Update lz4_flex to 0.11
emilk Nov 19, 2023
1826ef2
Fixed deadlock due to the use of `egui_ctx` from within a `egui_ctx.i…
abey79 Nov 20, 2023
3bf9a92
Merge branch 'main' into andreas/wgpu-0.18
abey79 Nov 20, 2023
dc677bd
Update egui and wasm-bindgen
emilk Nov 21, 2023
e677a93
update to puffin 0.18
emilk Nov 21, 2023
8611485
Update to latest egui master
emilk Nov 22, 2023
908f71c
Update to latest egui, with zoom_factor and fix for decorations
emilk Nov 23, 2023
4dd89ea
Fix size caluclation in top bar
emilk Nov 23, 2023
5734908
Merge branch 'main' into andreas/wgpu-0.18
emilk Nov 23, 2023
dec6321
Update to latest egui
emilk Nov 23, 2023
324ac1d
Smooth zooming with clamping
emilk Nov 23, 2023
6a23d32
Restore zoom factor after screenshot
emilk Nov 23, 2023
310b6a2
Use set_zoom_factor
emilk Nov 23, 2023
f23461e
Sort
emilk Nov 23, 2023
17c40bc
Udate to egui 0.24, egui_tiles 0.4, egui_commonmark 0.10
emilk Nov 23, 2023
8ff55eb
Silence clippy warning from macro
emilk Nov 24, 2023
d92873e
Merge branch 'main' into andreas/wgpu-0.18
emilk Nov 30, 2023
e479727
Update to egui 0.24.1
emilk Nov 30, 2023
d67e11f
less mut
emilk Nov 30, 2023
73199e5
Update to wasm-bindgen 0.2.89
emilk Nov 30, 2023
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
802 changes: 568 additions & 234 deletions Cargo.lock

Large diffs are not rendered by default.

70 changes: 45 additions & 25 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,28 @@ re_web_viewer_server = { path = "crates/re_web_viewer_server", version = "=0.12.
re_ws_comms = { path = "crates/re_ws_comms", version = "=0.12.0-alpha.1", default-features = false }
rerun = { path = "crates/rerun", version = "=0.12.0-alpha.1", default-features = false }

# egui-crates:
ecolor = "0.24.1"
eframe = { version = "0.24.1", default-features = false, features = [
"accesskit",
"default_fonts",
"puffin",
"wayland",
"x11",
] }
egui = { version = "0.24.1", features = [
"callstack",
"extra_debug_asserts",
"log",
"puffin",
] }
egui_commonmark = { version = "0.10", default-features = false }
egui_extras = { version = "0.24.1", features = ["http", "image", "puffin"] }
egui_plot = "0.24.1"
egui_tiles = "0.4"
egui-wgpu = "0.24.1"
emath = "0.24.1"

# All of our direct external dependencies should be found here:
ahash = "0.8"
anyhow = "1.0"
Expand All @@ -94,27 +116,7 @@ criterion = "0.5"
crossbeam = "0.8"
directories-next = "2"
document-features = "0.2"
ecolor = "0.23.0"
eframe = { version = "0.23.0", default-features = false, features = [
"accesskit",
"default_fonts",
"puffin",
"wayland",
"x11",
] }
egui = { version = "0.23.0", features = [
"callstack",
"extra_debug_asserts",
"log",
"puffin",
] }
egui_commonmark = { version = "0.9.2", default-features = false }
egui_extras = { version = "0.23.0", features = ["http", "image", "puffin"] }
egui_plot = "0.23.0"
egui_tiles = "0.3.1"
egui-wgpu = "0.23.0"
ehttp = "0.3.1"
emath = "0.23.0"
enumset = "1.0.12"
env_logger = "0.10"
epaint = "0.23.0"
Expand All @@ -132,6 +134,7 @@ infer = "0.15" # infer MIME type by checking the magic number signature
itertools = "0.11"
js-sys = "0.3"
lazy_static = "1.4"
lz4_flex = "0.11"
log = "0.4"
log-once = "0.4"
macaw = "0.18"
Expand All @@ -156,8 +159,8 @@ polars-lazy = "0.29"
polars-ops = "0.29"
poll-promise = "0.3"
pollster = "0.3"
puffin = "0.16"
puffin_http = "0.13"
puffin = "0.18"
puffin_http = "0.15"
rand = { version = "0.8", default-features = false }
rayon = "1.7"
rfd = { version = "0.12", default_features = false, features = ["xdg-portal"] }
Expand Down Expand Up @@ -192,16 +195,16 @@ unindent = "0.1"
uuid = "1.1"
vec1 = "1.8"
walkdir = "2.0"
wasm-bindgen = "0.2.87"
wasm-bindgen = "0.2.89"
wasm-bindgen-futures = "0.4.33"
web-sys = "0.3.61"
web-time = "0.2.0"
webbrowser = "0.8"
winit = "0.28.7"
# 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 = "0.17.0", features = ["fragile-send-sync-non-atomic-wasm"] }
wgpu-core = "0.17.0"
wgpu = { version = "0.18.0", features = ["fragile-send-sync-non-atomic-wasm"] }
wgpu-core = "0.18.0"
xshell = "0.2"
zip = { version = "0.6", default-features = false }
zune-core = "0.2"
Expand Down Expand Up @@ -232,3 +235,20 @@ debug = true
# If that is not possible, patch to a branch that has a PR open on the upstream repo.
# 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 = "a2b15b23ad26f077e229d492cd1571d97217d570" } # egui master 2023-11-23
# eframe = { git = "https://github.com/emilk/egui.git", rev = "a2b15b23ad26f077e229d492cd1571d97217d570" } # egui master 2023-11-23
# egui = { git = "https://github.com/emilk/egui.git", rev = "a2b15b23ad26f077e229d492cd1571d97217d570" } # egui master 2023-11-23
# egui_extras = { git = "https://github.com/emilk/egui.git", rev = "a2b15b23ad26f077e229d492cd1571d97217d570" } # egui master 2023-11-23
# egui-wgpu = { git = "https://github.com/emilk/egui.git", rev = "a2b15b23ad26f077e229d492cd1571d97217d570" } # egui master 2023-11-23
# emath = { git = "https://github.com/emilk/egui.git", rev = "a2b15b23ad26f077e229d492cd1571d97217d570" } # egui master 2023-11-23
# epaint = { git = "https://github.com/emilk/egui.git", rev = "a2b15b23ad26f077e229d492cd1571d97217d570" } # egui master 2023-11-23

# Useful while developing:
# ecolor = { path = "../../egui/crates/ecolor" }
# eframe = { path = "../../egui/crates/eframe" }
# egui = { path = "../../egui/crates/egui" }
# egui_extras = { path = "../../egui/crates/egui_extras" }
# egui-wgpu = { path = "../../egui/crates/egui-wgpu" }
# emath = { path = "../../egui/crates/emath" }
# epaint = { path = "../../egui/crates/epaint" }
2 changes: 1 addition & 1 deletion crates/re_build_web_viewer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ re_error.workspace = true

anyhow.workspace = true
cargo_metadata = "0.15"
wasm-bindgen-cli-support = "0.2.87"
wasm-bindgen-cli-support = "0.2.89"
12 changes: 6 additions & 6 deletions crates/re_log_encoding/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,20 @@ thiserror.workspace = true
web-time.workspace = true

# Optional external dependencies:
lz4_flex = { workspace = true, optional = true }
rmp-serde = { workspace = true, optional = true }
lz4_flex = { version = "0.10", optional = true }

# Web dependencies:
[target.'cfg(target_arch = "wasm32")'.dependencies]
js-sys = "0.3"
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
web-sys = { version = "0.3.52", features = ["Window"] }
js-sys.workspace = true
wasm-bindgen.workspace = true
wasm-bindgen-futures.workspace = true
web-sys = { workspace = true, features = ["Window"] }

[dev-dependencies]
re_types = { workspace = true, features = ["datagen", "serde"] }

criterion = "0.5"
criterion.workspace = true
mimalloc.workspace = true
serde_test.workspace = true

Expand Down
6 changes: 5 additions & 1 deletion crates/re_renderer/examples/framework.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ impl<E: Example + 'static> Application<E> {
let size = window.inner_size();
let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
backends: supported_backends(),
flags: wgpu::InstanceFlags::default(),
dx12_shader_compiler: wgpu::Dx12Compiler::Fxc,
gles_minor_version: wgpu::Gles3MinorVersion::Automatic,
});
#[allow(unsafe_code, clippy::undocumented_unsafe_blocks)]
let surface = unsafe { instance.create_surface(&window) }.unwrap();
Expand Down Expand Up @@ -282,10 +284,12 @@ impl<E: Example + 'static> Application<E> {
resolve_target: None,
ops: wgpu::Operations {
load: wgpu::LoadOp::Clear(wgpu::Color::BLACK),
store: true,
store: wgpu::StoreOp::Store,
},
})],
depth_stencil_attachment: None,
timestamp_writes: None,
occlusion_query_set: None,
});

for draw_result in &draw_results {
Expand Down
12 changes: 9 additions & 3 deletions crates/re_renderer/src/draw_phases/outlines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,17 +354,19 @@ impl OutlineMaskProcessor {
resolve_target: None, // We're going to do a manual resolve.
ops: wgpu::Operations {
load: wgpu::LoadOp::Clear(wgpu::Color::TRANSPARENT),
store: true,
store: wgpu::StoreOp::Store,
},
})],
depth_stencil_attachment: Some(wgpu::RenderPassDepthStencilAttachment {
view: &self.mask_depth.default_view,
depth_ops: Some(wgpu::Operations {
load: ViewBuilder::DEFAULT_DEPTH_CLEAR,
store: false,
store: wgpu::StoreOp::Discard,
}),
stencil_ops: None,
}),
timestamp_writes: None,
occlusion_query_set: None,
})
}

Expand All @@ -377,7 +379,7 @@ impl OutlineMaskProcessor {

let ops = wgpu::Operations {
load: wgpu::LoadOp::Clear(wgpu::Color::TRANSPARENT), // Clear is the closest to "don't care"
store: true,
store: wgpu::StoreOp::Store,
};

// Initialize the jump flooding into voronoi texture 0 by looking at the mask texture.
Expand All @@ -390,6 +392,8 @@ impl OutlineMaskProcessor {
ops,
})],
depth_stencil_attachment: None,
timestamp_writes: None,
occlusion_query_set: None,
});

let render_pipeline_init =
Expand All @@ -412,6 +416,8 @@ impl OutlineMaskProcessor {
ops,
})],
depth_stencil_attachment: None,
timestamp_writes: None,
occlusion_query_set: None,
});

jumpflooding_step.set_pipeline(render_pipeline_step);
Expand Down
10 changes: 7 additions & 3 deletions crates/re_renderer/src/draw_phases/picking_layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,17 +321,19 @@ impl PickingLayerProcessor {
resolve_target: None,
ops: wgpu::Operations {
load: wgpu::LoadOp::Clear(wgpu::Color::TRANSPARENT),
store: true, // Store for readback!
store: wgpu::StoreOp::Store, // Store for readback!
},
})],
depth_stencil_attachment: Some(wgpu::RenderPassDepthStencilAttachment {
view: &self.picking_depth_target.default_view,
depth_ops: Some(wgpu::Operations {
load: ViewBuilder::DEFAULT_DEPTH_CLEAR,
store: true, // Store for readback!
store: wgpu::StoreOp::Store, // Store for readback!
}),
stencil_ops: None,
}),
timestamp_writes: None,
occlusion_query_set: None,
});

pass.set_bind_group(0, &self.bind_group_0, &[]);
Expand Down Expand Up @@ -590,10 +592,12 @@ impl DepthReadbackWorkaround {
resolve_target: None,
ops: wgpu::Operations {
load: wgpu::LoadOp::Clear(wgpu::Color::TRANSPARENT),
store: true, // Store for readback!
store: wgpu::StoreOp::Store, // Store for readback!
},
})],
depth_stencil_attachment: None,
timestamp_writes: None,
occlusion_query_set: None,
});

let pipeline = pools.render_pipelines.get_resource(self.render_pipeline)?;
Expand Down
4 changes: 3 additions & 1 deletion crates/re_renderer/src/draw_phases/screenshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,12 @@ impl ScreenshotProcessor {
resolve_target: None,
ops: wgpu::Operations {
load: wgpu::LoadOp::Clear(wgpu::Color::TRANSPARENT),
store: true,
store: wgpu::StoreOp::Store,
},
})],
depth_stencil_attachment: None,
timestamp_writes: None,
occlusion_query_set: None,
});

pass
Expand Down
6 changes: 4 additions & 2 deletions crates/re_renderer/src/view_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -556,17 +556,19 @@ impl ViewBuilder {
}),
// Don't care about the result, it's going to be resolved to the resolve target.
// This can have be much better perf, especially on tiler gpus.
store: false,
store: wgpu::StoreOp::Discard,
},
})],
depth_stencil_attachment: Some(wgpu::RenderPassDepthStencilAttachment {
view: &setup.depth_buffer.default_view,
depth_ops: Some(wgpu::Operations {
load: Self::DEFAULT_DEPTH_CLEAR,
store: false,
store: wgpu::StoreOp::Discard,
}),
stencil_ops: None,
}),
timestamp_writes: None,
occlusion_query_set: None,
});

pass.set_bind_group(0, &setup.bind_group_0, &[]);
Expand Down
10 changes: 3 additions & 7 deletions crates/re_space_view_bar_chart/src/space_view_class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,9 @@ impl SpaceViewClass for BarChartSpaceView {
let zoom_both_axis = !ui.input(|i| i.modifiers.contains(controls::ASPECT_SCROLL_MODIFIER));

ui.scope(|ui| {
let mut plot =
Plot::new("bar_chart_plot")
.clamp_grid(true)
.allow_zoom(egui_plot::AxisBools {
x: true,
y: zoom_both_axis,
});
let mut plot = Plot::new("bar_chart_plot")
.clamp_grid(true)
.allow_zoom([true, zoom_both_axis]);

if *root_entity_properties.show_legend {
plot = plot.legend(Legend {
Expand Down
7 changes: 3 additions & 4 deletions crates/re_space_view_spatial/src/eye.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,8 @@ impl OrbitEye {
return; // e.g. we're typing in a TextField
}

let os = egui_ctx.os();

let requires_repaint = egui_ctx.input(|input| {
let dt = input.stable_dt.at_most(0.1);

Expand All @@ -390,10 +392,7 @@ impl OrbitEye {
} else {
1.0
})
* (if input
.modifiers
.contains(RuntimeModifiers::slow_down(&egui_ctx.os()))
{
* (if input.modifiers.contains(RuntimeModifiers::slow_down(&os)) {
0.1
} else {
1.0
Expand Down
5 changes: 1 addition & 4 deletions crates/re_space_view_time_series/src/space_view_class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,7 @@ impl SpaceViewClass for TimeSeriesSpaceView {

let time_zone_for_timestamps = ctx.app_options.time_zone_for_timestamps;
let mut plot = Plot::new(plot_id_src)
.allow_zoom(egui_plot::AxisBools {
x: true,
y: zoom_both_axis,
})
.allow_zoom([true, zoom_both_axis])
.x_axis_formatter(move |time, _, _| {
format_time(
time_type,
Expand Down
4 changes: 2 additions & 2 deletions crates/re_time_panel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ impl TimePanel {
ui.visuals().widgets.noninteractive.bg_stroke,
);

ui.spacing_mut().scroll_bar_outer_margin = 4.0; // needed, because we have no panel margin on the right side.
ui.spacing_mut().scroll.bar_outer_margin = 4.0; // needed, because we have no panel margin on the right side.

// Add extra margin on the left which was intentionally missing on the controls.
let mut streams_frame = egui::Frame::default();
Expand Down Expand Up @@ -238,7 +238,7 @@ impl TimePanel {
let time_bg_x_range = Rangef::new(time_x_left, ui.max_rect().right());
let time_fg_x_range = {
// Painting to the right of the scroll bar (if any) looks bad:
let right = ui.max_rect().right() - ui.spacing_mut().scroll_bar_outer_margin;
let right = ui.max_rect().right() - ui.spacing_mut().scroll.bar_outer_margin;
debug_assert!(time_x_left < right);
Rangef::new(time_x_left, right)
};
Expand Down
8 changes: 1 addition & 7 deletions crates/re_ui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ all-features = true


[features]
default = ["eframe"]

eframe = ["dep:eframe"]

default = []

[dependencies]
egui_extras.workspace = true
Expand All @@ -37,9 +34,6 @@ strum.workspace = true
strum_macros.workspace = true
sublime_fuzzy.workspace = true

## Optional dependencies:
eframe = { workspace = true, optional = true, default-features = false }

[dev-dependencies]
eframe = { workspace = true, default-features = false, features = ["wgpu"] }
egui_tiles.workspace = true
Expand Down
Loading
Loading