Profiling support (#743)
This commit is contained in:
@@ -21,6 +21,41 @@ pub fn update_ui(
|
||||
harness: &mut Harness,
|
||||
debug_render: &mut DebugRenderPipelineResource,
|
||||
) {
|
||||
#[cfg(feature = "profiling")]
|
||||
{
|
||||
let window = egui::Window::new("Profiling");
|
||||
let window = window.default_open(false);
|
||||
|
||||
#[cfg(feature = "unstable-puffin-pr-235")]
|
||||
{
|
||||
use std::sync::Once;
|
||||
static START: Once = Once::new();
|
||||
|
||||
fn set_default_rapier_filter() {
|
||||
let mut profile_ui = puffin_egui::PROFILE_UI.lock();
|
||||
profile_ui
|
||||
.profiler_ui
|
||||
.flamegraph_options
|
||||
.scope_name_filter
|
||||
.set_filter("Harness::step_with_graphics".to_string());
|
||||
}
|
||||
START.call_once(|| {
|
||||
set_default_rapier_filter();
|
||||
});
|
||||
window.show(ui_context.ctx_mut(), |ui| {
|
||||
if ui.button("🔍 Rapier filter").clicked() {
|
||||
set_default_rapier_filter();
|
||||
}
|
||||
puffin_egui::profiler_ui(ui);
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "unstable-puffin-pr-235"))]
|
||||
window.show(ui_context.ctx_mut(), |ui| {
|
||||
puffin_egui::profiler_ui(ui);
|
||||
});
|
||||
}
|
||||
|
||||
egui::Window::new("Parameters").show(ui_context.ctx_mut(), |ui| {
|
||||
if state.backend_names.len() > 1 && !state.example_names.is_empty() {
|
||||
let mut changed = false;
|
||||
|
||||
Reference in New Issue
Block a user