Skip to content

Commit

Permalink
Include tessellation and rendering in CPU time shown in top bar (#4951)
Browse files Browse the repository at this point in the history
### What
This got more accurate in emilk/egui#3913

### 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 newly built examples:
[app.rerun.io](https://app.rerun.io/pr/4951/index.html)
* Using examples from latest `main` build:
[app.rerun.io](https://app.rerun.io/pr/4951/index.html?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[app.rerun.io](https://app.rerun.io/pr/4951/index.html?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

- [PR Build Summary](https://build.rerun.io/pr/4951)
- [Docs
preview](https://rerun.io/preview/4a12c750840ffa02ba0ea1ca710d00367336144b/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/4a12c750840ffa02ba0ea1ca710d00367336144b/examples)
<!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)
  • Loading branch information
emilk authored Jan 30, 2024
1 parent 5d9b278 commit 5604f1d
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 29 deletions.
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

0 comments on commit 5604f1d

Please sign in to comment.