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

Include tessellation and rendering in CPU time shown in top bar #4951

Merged
merged 1 commit into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
22 changes: 12 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -277,13 +277,13 @@ debug = true
# 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 = "6b0782c96b76349da9be785d0e9054f87cd7b00a" } # egui master 2024-01-26
eframe = { git = "https://github.com/emilk/egui.git", rev = "6b0782c96b76349da9be785d0e9054f87cd7b00a" } # egui master 2024-01-26
egui = { git = "https://github.com/emilk/egui.git", rev = "6b0782c96b76349da9be785d0e9054f87cd7b00a" } # egui master 2024-01-26
egui_extras = { git = "https://github.com/emilk/egui.git", rev = "6b0782c96b76349da9be785d0e9054f87cd7b00a" } # egui master 2024-01-26
egui_plot = { git = "https://github.com/emilk/egui.git", rev = "6b0782c96b76349da9be785d0e9054f87cd7b00a" } # egui master 2024-01-26
egui-wgpu = { git = "https://github.com/emilk/egui.git", rev = "6b0782c96b76349da9be785d0e9054f87cd7b00a" } # egui master 2024-01-26
emath = { git = "https://github.com/emilk/egui.git", rev = "6b0782c96b76349da9be785d0e9054f87cd7b00a" } # egui master 2024-01-26
ecolor = { git = "https://github.com/emilk/egui.git", rev = "ab39420c2933d2e402999043375b64e7cf0ee9ed" } # egui master 2024-01-29
eframe = { git = "https://github.com/emilk/egui.git", rev = "ab39420c2933d2e402999043375b64e7cf0ee9ed" } # egui master 2024-01-29
egui = { git = "https://github.com/emilk/egui.git", rev = "ab39420c2933d2e402999043375b64e7cf0ee9ed" } # egui master 2024-01-29
egui_extras = { git = "https://github.com/emilk/egui.git", rev = "ab39420c2933d2e402999043375b64e7cf0ee9ed" } # egui master 2024-01-29
egui_plot = { git = "https://github.com/emilk/egui.git", rev = "ab39420c2933d2e402999043375b64e7cf0ee9ed" } # egui master 2024-01-29
egui-wgpu = { git = "https://github.com/emilk/egui.git", rev = "ab39420c2933d2e402999043375b64e7cf0ee9ed" } # egui master 2024-01-29
emath = { git = "https://github.com/emilk/egui.git", rev = "ab39420c2933d2e402999043375b64e7cf0ee9ed" } # egui master 2024-01-29

# Useful while developing:
# ecolor = { path = "../../egui/crates/ecolor" }
Expand Down
2 changes: 1 addition & 1 deletion crates/re_space_view_time_series/src/space_view_class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ impl SpaceViewClass for TimeSeriesSpaceView {
.x_axis_formatter(move |time, _, _| {
format_time(
time_type,
time as i64 + time_offset,
time.value as i64 + time_offset,
time_zone_for_timestamps,
)
})
Expand Down
13 changes: 4 additions & 9 deletions crates/re_viewer/src/app.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use web_time::Instant;

use re_data_source::{DataSource, FileContents};
use re_entity_db::entity_db::EntityDb;
use re_log_types::{FileSource, LogMsg, StoreKind};
Expand Down Expand Up @@ -1103,7 +1101,10 @@ impl eframe::App for App {
}

fn update(&mut self, egui_ctx: &egui::Context, frame: &mut eframe::Frame) {
let frame_start = Instant::now();
if let Some(seconds) = frame.info().cpu_usage {
self.frame_time_history
.add(egui_ctx.input(|i| i.time), seconds);
}

// Temporarily take the `StoreHub` out of the Viewer so it doesn't interfere with mutability
let mut store_hub = self.store_hub.take().unwrap();
Expand Down Expand Up @@ -1237,12 +1238,6 @@ impl eframe::App for App {
open_url.new_tab = true;
}
});

// Frame time measurer - must be last
self.frame_time_history.add(
egui_ctx.input(|i| i.time),
frame_start.elapsed().as_secs_f32(),
);
}

#[cfg(target_arch = "wasm32")]
Expand Down
4 changes: 2 additions & 2 deletions crates/re_viewer/src/ui/memory_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,8 +540,8 @@ impl MemoryPanel {
egui_plot::Plot::new("mem_history_plot")
.min_size(egui::Vec2::splat(200.0))
.label_formatter(|name, value| format!("{name}: {}", format_bytes(value.y)))
.x_axis_formatter(|time, _, _| format!("{time} s"))
.y_axis_formatter(|bytes, _, _| format_bytes(bytes))
.x_axis_formatter(|time, _, _| format!("{} s", time.value))
.y_axis_formatter(|bytes, _, _| format_bytes(bytes.value))
.show_x(false)
.legend(egui_plot::Legend::default().position(egui_plot::Corner::LeftTop))
.include_y(0.0)
Expand Down
Loading