refactor(tracy): mark/demark relevant functions

This commit is contained in:
Nova
2024-07-26 05:53:13 -04:00
parent 36d91fd999
commit 13815d4d20
4 changed files with 233 additions and 181 deletions

View File

@@ -232,31 +232,29 @@ fn stereokit_loop(
let mut last_frame_delta = Duration::ZERO;
let mut sleep_duration = Duration::ZERO;
debug_span!("StereoKit").in_scope(|| {
while let Some(token) = sk.step() {
let _span = debug_span!("StereoKit step");
let _span = _span.enter();
while let Some(token) = sk.step() {
let _span = debug_span!("StereoKit step");
let _span = _span.enter();
camera::update(token);
#[cfg(feature = "wayland")]
wayland.frame_event();
destroy_queue::clear();
camera::update(token);
#[cfg(feature = "wayland")]
wayland.frame_event();
destroy_queue::clear();
objects.update(&sk, token);
input::process_input();
nodes::root::Root::send_frame_events(Time::get_step_unscaled());
adaptive_sleep(
&mut last_frame_delta,
&mut sleep_duration,
Duration::from_micros(250),
);
objects.update(&sk, token);
input::process_input();
nodes::root::Root::send_frame_events(Time::get_step_unscaled());
adaptive_sleep(
&mut last_frame_delta,
&mut sleep_duration,
Duration::from_micros(250),
);
#[cfg(feature = "wayland")]
wayland.update();
drawable::draw(token);
audio::update();
}
});
#[cfg(feature = "wayland")]
wayland.update();
drawable::draw(token);
audio::update();
}
info!("Cleanly shut down StereoKit");
#[cfg(feature = "wayland")]

View File

@@ -17,7 +17,6 @@ use crate::{core::registry::Registry, nodes::spatial::Transform};
use color_eyre::eyre::Result;
use stardust_xr::values::Datamap;
use std::sync::Arc;
use tracing::debug_span;
static INPUT_METHOD_REGISTRY: Registry<InputMethod> = Registry::new();
pub static INPUT_HANDLER_REGISTRY: Registry<InputHandler> = Registry::new();
@@ -91,17 +90,15 @@ impl InterfaceAspect for InputInterface {
#[tracing::instrument(level = "debug")]
pub fn process_input() {
// Iterate over all valid input methods
let methods = debug_span!("Get valid methods").in_scope(|| {
INPUT_METHOD_REGISTRY
.get_valid_contents()
.into_iter()
.filter(|method| {
let Some(node) = method.spatial.node() else {
return false;
};
node.enabled()
})
});
let methods = INPUT_METHOD_REGISTRY
.get_valid_contents()
.into_iter()
.filter(|method| {
let Some(node) = method.spatial.node() else {
return false;
};
node.enabled()
});
for handler in INPUT_HANDLER_REGISTRY.get_valid_contents() {
for method_alias in handler.method_aliases.get_aliases() {
method_alias.set_enabled(false);