diff --git a/Cargo.lock b/Cargo.lock index 09ea6fe..c32a57e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -836,6 +836,19 @@ dependencies = [ "pin-utils", ] +[[package]] +name = "generator" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc16584ff22b460a382b7feec54b23d2908d858152e5739a120b949293bd74e" +dependencies = [ + "cc", + "libc", + "log", + "rustversion", + "windows", +] + [[package]] name = "gethostname" version = "0.3.0" @@ -1202,6 +1215,19 @@ version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +[[package]] +name = "loom" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" +dependencies = [ + "cfg-if", + "generator", + "scoped-tls", + "tracing", + "tracing-subscriber", +] + [[package]] name = "manifest-dir-macros" version = "0.1.18" @@ -2093,6 +2119,7 @@ dependencies = [ "console-subscriber", "ctrlc", "directories", + "drm-fourcc", "glam 0.23.0", "global_counter", "input-event-codes", @@ -2114,8 +2141,8 @@ dependencies = [ "stereokit", "tokio", "tracing", - "tracing-chrome", "tracing-subscriber", + "tracing-tracy", "xkbcommon", ] @@ -2396,17 +2423,6 @@ dependencies = [ "syn 2.0.37", ] -[[package]] -name = "tracing-chrome" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "496b3cd5447f7ff527bbbf19b071ad542a000adf297d4127078b4dfdb931f41a" -dependencies = [ - "serde_json", - "tracing-core", - "tracing-subscriber", -] - [[package]] name = "tracing-core" version = "0.1.31" @@ -2446,6 +2462,37 @@ dependencies = [ "tracing-log", ] +[[package]] +name = "tracing-tracy" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc6c7bf057d67aa107e076129a4f331aaac47ec379952d9f0775c6b1d838ee97" +dependencies = [ + "tracing-core", + "tracing-subscriber", + "tracy-client", +] + +[[package]] +name = "tracy-client" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03684af8fb393cc7903210d868e4cb9f5c1e156737be38f52c4217fb21b86bf6" +dependencies = [ + "loom", + "once_cell", + "tracy-client-sys", +] + +[[package]] +name = "tracy-client-sys" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cb915ea3af048554640d76dd6f1492589a6401a41a30d789b983c1ec280455a" +dependencies = [ + "cc", +] + [[package]] name = "try-lock" version = "0.2.4" @@ -2622,6 +2669,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +dependencies = [ + "windows-targets", +] + [[package]] name = "windows-sys" version = "0.48.0" diff --git a/Cargo.toml b/Cargo.toml index e23e37b..ddd5484 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ default = ["wayland"] wayland = ["dep:smithay", "dep:xkbcommon"] xwayland = ["smithay/xwayland"] profile_tokio = ["dep:console-subscriber", "tokio/tracing"] -profile_app = ["dep:tracing-chrome"] +profile_app = ["dep:tracing-tracy"] [package.metadata.appimage] auto_link = true @@ -58,8 +58,9 @@ tracing-subscriber = { version = "0.3.17", features = ["env-filter"] } global_counter = "0.2.2" rand = "0.8.5" atty = "0.2.14" -libc = "0.2.148" +xkbcommon = { version = "0.6.0", default-features = false, optional = true } ctrlc = "3.4.1" +libc = "0.2.148" input-event-codes = "5.16.8" drm-fourcc = { version = "2.2.0", features = ["serde"] } @@ -87,8 +88,8 @@ version = "0.16.9" version = "0.1.8" optional = true -[dependencies.tracing-chrome] -version = "0.7.1" +[dependencies.tracing-tracy] +version = "0.10.4" optional = true [dependencies.stardust-xr] diff --git a/src/core/node_collections.rs b/src/core/node_collections.rs index a02b820..169373c 100644 --- a/src/core/node_collections.rs +++ b/src/core/node_collections.rs @@ -7,33 +7,32 @@ use std::{ sync::{Arc, Weak}, }; -#[derive(Default)] -pub struct LifeLinkedNodeList { - nodes: Mutex>>, -} -impl LifeLinkedNodeList { - pub fn add(&self, node: Weak) { - self.nodes.lock().push(node); - } +// #[derive(Default)] +// pub struct LifeLinkedNodeList { +// nodes: Mutex>>, +// } +// impl LifeLinkedNodeList { +// pub fn add(&self, node: Weak) { +// self.nodes.lock().push(node); +// } +// pub fn clear(&self) { +// self.nodes +// .lock() +// .iter() +// .filter_map(|node| node.upgrade()) +// .for_each(|node| { +// node.destroy(); +// }); +// self.nodes.lock().clear(); +// } +// } +// impl Drop for LifeLinkedNodeList { +// fn drop(&mut self) { +// self.clear(); +// } +// } - pub fn clear(&self) { - self.nodes - .lock() - .iter() - .filter_map(|node| node.upgrade()) - .for_each(|node| { - node.destroy(); - }); - self.nodes.lock().clear(); - } -} -impl Drop for LifeLinkedNodeList { - fn drop(&mut self) { - self.clear(); - } -} - -#[derive(Default)] +#[derive(Default, Debug)] pub struct LifeLinkedNodeMap { nodes: Mutex>>, } diff --git a/src/core/scenegraph.rs b/src/core/scenegraph.rs index 8f161b7..db509cb 100644 --- a/src/core/scenegraph.rs +++ b/src/core/scenegraph.rs @@ -3,13 +3,14 @@ use crate::{core::client::Client, nodes::Message}; use color_eyre::eyre::Result; use once_cell::sync::OnceCell; use parking_lot::Mutex; +use portable_atomic::Ordering; use rustc_hash::FxHashMap; use stardust_xr::scenegraph; use stardust_xr::scenegraph::ScenegraphError; use std::os::fd::OwnedFd; use std::sync::{Arc, Weak}; use tokio::sync::oneshot; -use tracing::{debug, debug_span, instrument}; +use tracing::{debug, debug_span}; #[derive(Default)] pub struct Scenegraph { @@ -33,11 +34,14 @@ impl Scenegraph { self.nodes.lock().insert(path, node); } - #[instrument(level = "debug", skip(self))] pub fn get_node(&self, path: &str) -> Option> { let mut node = self.nodes.lock().get(path)?.clone(); while let Some(alias) = node.alias.get() { - node = alias.original.upgrade()?; + if alias.enabled.load(Ordering::Relaxed) { + node = alias.original.upgrade()?; + } else { + return None; + } } Some(node) } diff --git a/src/core/task.rs b/src/core/task.rs index 6392efc..43bffd8 100644 --- a/src/core/task.rs +++ b/src/core/task.rs @@ -1,10 +1,8 @@ use color_eyre::eyre::Result; use std::future::Future; use tokio::task::JoinHandle; -use tracing::instrument; #[allow(unused_variables)] -#[instrument(level = "debug", skip_all)] pub fn new< F: FnOnce() -> S, S: AsRef, diff --git a/src/main.rs b/src/main.rs index 0ba488d..14f588d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -67,14 +67,18 @@ struct EventLoopInfo { socket_path: PathBuf, } -fn setup_tracing() { +fn main() { + ctrlc::set_handler(|| { + if atty::isnt(atty::Stream::Stdout) { + STOP_NOTIFIER.notify_waiters() + } + }) + .unwrap(); + let registry = tracing_subscriber::registry(); + #[cfg(feature = "profile_app")] - let (chrome_layer, _guard) = tracing_chrome::ChromeLayerBuilder::new() - .include_args(true) - .build(); - #[cfg(feature = "profile_app")] - let registry = registry.with(chrome_layer); + let registry = registry.with(tracing_tracy::TracyLayer::new().with_filter(LevelFilter::DEBUG)); #[cfg(feature = "profile_tokio")] let (console_layer, _) = console_subscriber::ConsoleLayer::builder().build(); @@ -87,17 +91,6 @@ fn setup_tracing() { .with_line_number(true) .with_filter(EnvFilter::from_default_env()); registry.with(log_layer).init(); -} - -fn main() { - ctrlc::set_handler(|| { - if atty::isnt(atty::Stream::Stdout) { - STOP_NOTIFIER.notify_waiters() - } - }) - .unwrap(); - - setup_tracing(); let project_dirs = ProjectDirs::from("", "", "stardust"); if project_dirs.is_none() { diff --git a/src/nodes/alias.rs b/src/nodes/alias.rs index df2e5c2..66aab1f 100644 --- a/src/nodes/alias.rs +++ b/src/nodes/alias.rs @@ -1,6 +1,7 @@ use super::Node; use crate::core::client::Client; use color_eyre::eyre::{ensure, Result}; +use portable_atomic::AtomicBool; use std::sync::{Arc, Weak}; #[derive(Debug, Default, Clone)] @@ -12,6 +13,7 @@ pub struct AliasInfo { #[allow(dead_code)] pub struct Alias { + pub enabled: Arc, pub(super) node: Weak, pub original: Weak, @@ -35,6 +37,7 @@ impl Alias { let node = Node::create(client, parent, name, true).add_to_scenegraph()?; let alias = Alias { + enabled: Arc::new(AtomicBool::new(true)), node: Arc::downgrade(&node), original: Arc::downgrade(original), info, diff --git a/src/nodes/data.rs b/src/nodes/data.rs index dafbcd5..02f8129 100644 --- a/src/nodes/data.rs +++ b/src/nodes/data.rs @@ -18,6 +18,7 @@ use rustc_hash::FxHashMap; use serde::{Deserialize, Serialize}; use stardust_xr::schemas::flex::{deserialize, flexbuffers, serialize}; use stardust_xr::values::Transform; +use std::fmt::Display; use std::sync::{Arc, Weak}; lazy_static! { @@ -32,6 +33,13 @@ pub fn mask_matches(mask_map_lesser: &Mask, mask_map_greater: &Mask) -> bool { for key in mask_map_lesser.get_mask()?.iter_keys() { let lesser_key = mask_map_lesser.get_mask()?.index(key)?; let greater_key = mask_map_greater.get_mask()?.index(key)?; + // otherwise zero-length vectors don't count the same as a single type vector + if lesser_key.flexbuffer_type().is_heterogenous_vector() + && lesser_key.as_vector().len() == 0 + && greater_key.flexbuffer_type().is_vector() + { + continue; + } if !lesser_key.flexbuffer_type().is_null() && lesser_key.flexbuffer_type() != greater_key.flexbuffer_type() { @@ -57,6 +65,14 @@ impl Mask { .map_err(|_| eyre!("Mask is not a valid map")) } } +impl Display for Mask { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + flexbuffers::Reader::get_root(self.0.as_slice()) + .unwrap() + .to_string() + .fmt(f) + } +} #[derive(Serialize, Deserialize)] struct SendDataInfo<'a> { @@ -179,7 +195,9 @@ impl PulseSender { data_mask.get_mask()?; ensure!( mask_matches(receiver_mask, &data_mask), - "Message does not contain the same keys as the receiver's mask" + "Message ({}) does not contain the same keys as the receiver's mask ({})", + data_mask, + receiver_mask ); receiver.send_data(&node.pulse_sender.get().unwrap().uid, data_mask.0) } diff --git a/src/nodes/hmd.rs b/src/nodes/hmd.rs index 54a390a..62d20cf 100644 --- a/src/nodes/hmd.rs +++ b/src/nodes/hmd.rs @@ -7,7 +7,6 @@ use color_eyre::eyre::Result; use glam::{vec3, Mat4}; use std::sync::Arc; use stereokit::StereoKitMultiThread; -use tracing::instrument; lazy_static::lazy_static! { static ref HMD: Arc = create(); @@ -20,7 +19,6 @@ fn create() -> Arc { node } -#[instrument(level = "debug", name = "Update HMD Pose", skip(sk))] pub fn frame(sk: &impl StereoKitMultiThread) { let spatial = HMD .spatial diff --git a/src/nodes/input/mod.rs b/src/nodes/input/mod.rs index 885dc85..e428544 100644 --- a/src/nodes/input/mod.rs +++ b/src/nodes/input/mod.rs @@ -12,8 +12,8 @@ use super::{ spatial::{find_spatial_parent, parse_transform, Spatial}, Message, Node, }; +use crate::core::registry::Registry; use crate::core::{client::Client, node_collections::LifeLinkedNodeMap}; -use crate::core::{node_collections::LifeLinkedNodeList, registry::Registry}; use color_eyre::eyre::{ensure, Result}; use glam::Mat4; use once_cell::sync::OnceCell; @@ -99,6 +99,7 @@ impl InputMethod { }; for handler in INPUT_HANDLER_REGISTRY.get_valid_contents() { method.handle_new_handler(&handler); + method.make_alias(&handler); } let method = INPUT_METHOD_REGISTRY.add(method); let _ = node.input_method.set(method.clone()); @@ -137,6 +138,26 @@ impl InputMethod { Ok(()) } + fn make_alias(&self, handler: &InputHandler) { + let Some(method_node) = self.node.upgrade() else {return}; + let Some(handler_node) = handler.node.upgrade() else {return}; + let Some(client) = handler_node.get_client() else {return}; + let Ok(method_alias) = Alias::create( + &client, + handler_node.get_path(), + &self.uid, + &method_node, + AliasInfo { + server_signals: vec!["capture"], + ..Default::default() + }, + ) else {return}; + method_alias.enabled.store(false, Ordering::Relaxed); + handler + .method_aliases + .add(self as *const InputMethod as usize, &method_alias); + } + fn compare_distance(&self, to: &Field) -> f32 { self.specialization .lock() @@ -201,25 +222,12 @@ pub struct DistanceLink { handler: Arc, } impl DistanceLink { - fn from(method: Arc, handler: Arc) -> Option { - let handler_node = handler.node.upgrade()?; - let method_alias = Alias::create( - &handler_node.get_client()?, - handler_node.get_path(), - &method.uid, - &method.node.upgrade()?, - AliasInfo { - server_signals: vec!["capture"], - ..Default::default() - }, - ) - .ok()?; - handler.method_aliases.add(Arc::downgrade(&method_alias)); - Some(DistanceLink { + fn from(method: Arc, handler: Arc) -> Self { + DistanceLink { distance: method.compare_distance(&handler.field), method, handler, - }) + } } fn send_input(&self, order: u32, datamap: Datamap) { @@ -249,7 +257,7 @@ pub struct InputHandler { node: Weak, spatial: Arc, field: Arc, - method_aliases: LifeLinkedNodeList, + method_aliases: LifeLinkedNodeMap, } impl InputHandler { pub fn add_to(node: &Arc, field: &Arc) -> Result<()> { @@ -264,9 +272,10 @@ impl InputHandler { node: Arc::downgrade(node), spatial: node.spatial.get().unwrap().clone(), field: field.clone(), - method_aliases: LifeLinkedNodeList::default(), + method_aliases: LifeLinkedNodeMap::default(), }; for method in INPUT_METHOD_REGISTRY.get_valid_contents() { + method.make_alias(&handler); method.handle_new_handler(&handler); } let handler = INPUT_HANDLER_REGISTRY.add(handler); @@ -343,10 +352,12 @@ pub fn process_input() { .filter(|method| method.datamap.lock().is_some()) }); let handlers = INPUT_HANDLER_REGISTRY.get_valid_contents(); - for handler in &handlers { - handler.method_aliases.clear(); - } + const LIMIT: usize = 50; for method in methods { + for alias in method.node.upgrade().unwrap().aliases.get_valid_contents() { + alias.enabled.store(false, Ordering::Relaxed); + } + debug_span!("Process input method").in_scope(|| { // Get all valid input handlers and convert them to DistanceLink objects let distance_links: Vec = debug_span!("Generate distance links") @@ -357,14 +368,16 @@ pub fn process_input() { .iter() .filter_map(|h| h.upgrade()) .filter(|handler| handler.enabled.load(Ordering::Relaxed)) - .filter_map(|handler| DistanceLink::from(method.clone(), handler)) + .map(|handler| DistanceLink::from(method.clone(), handler)) .collect() } else { let mut distance_links: Vec<_> = handlers .iter() .filter(|handler| handler.enabled.load(Ordering::Relaxed)) - .filter_map(|handler| { - DistanceLink::from(method.clone(), handler.clone()) + .map(|handler| { + debug_span!("Create distance link").in_scope(|| { + DistanceLink::from(method.clone(), handler.clone()) + }) }) .collect(); @@ -375,6 +388,7 @@ pub fn process_input() { }); }); + distance_links.truncate(LIMIT); distance_links } }); @@ -382,6 +396,18 @@ pub fn process_input() { let captures = method.captures.take_valid_contents(); // Iterate over the distance links and send input to them for (i, distance_link) in distance_links.into_iter().enumerate() { + if i > LIMIT { + break; + } + + if let Some(method_alias) = distance_link + .handler + .method_aliases + .get(&(Arc::as_ptr(&distance_link.method) as usize)) + .and_then(|a| a.alias.get().cloned()) + { + method_alias.enabled.store(true, Ordering::Relaxed); + } distance_link.send_input(i as u32, method.datamap.lock().clone().unwrap()); // If the current distance link is in the list of captured input handlers, diff --git a/src/nodes/input/pointer.rs b/src/nodes/input/pointer.rs index 65878b5..f9148f5 100644 --- a/src/nodes/input/pointer.rs +++ b/src/nodes/input/pointer.rs @@ -34,9 +34,13 @@ impl Pointer { impl InputSpecialization for Pointer { fn compare_distance(&self, space: &Arc, field: &Field) -> f32 { let ray_info = self.ray_march(space, field); - ray_info - .deepest_point_distance - .hypot(ray_info.min_distance.recip()) + if ray_info.min_distance > 0.0 { + ray_info.deepest_point_distance + 1000.0 + } else { + ray_info + .deepest_point_distance + .hypot(0.001 / ray_info.min_distance) + } } fn true_distance(&self, space: &Arc, field: &Field) -> f32 { let ray_info = self.ray_march(space, field); diff --git a/src/nodes/mod.rs b/src/nodes/mod.rs index 910b5ad..b4b35bf 100644 --- a/src/nodes/mod.rs +++ b/src/nodes/mod.rs @@ -23,7 +23,6 @@ use std::future::Future; use std::os::fd::OwnedFd; use std::sync::{Arc, Weak}; use std::vec::Vec; -use tracing::instrument; use crate::core::client::Client; use crate::core::registry::Registry; @@ -272,7 +271,6 @@ impl Node { method(self, calling_client, message, response); } } - #[instrument(level = "debug", skip_all)] pub fn send_remote_signal(&self, method: &str, message: impl Into) -> Result<()> { let message = message.into(); self.aliases @@ -297,7 +295,6 @@ impl Node { } Ok(()) } - // #[instrument(level = "debug", skip_all)] pub fn execute_remote_method( &self, method: &str, diff --git a/src/nodes/spatial/mod.rs b/src/nodes/spatial/mod.rs index 75e86b0..becf2d5 100644 --- a/src/nodes/spatial/mod.rs +++ b/src/nodes/spatial/mod.rs @@ -17,7 +17,6 @@ use std::fmt::Debug; use std::ptr; use std::sync::{Arc, OnceLock, Weak}; use stereokit::{bounds_grow_to_fit_box, Bounds}; -use tracing::instrument; static ZONEABLE_REGISTRY: Registry = Registry::new(); @@ -81,7 +80,6 @@ impl Spatial { self.node.upgrade() } - #[instrument(level = "debug", skip_all)] pub fn space_to_space_matrix(from: Option<&Spatial>, to: Option<&Spatial>) -> Mat4 { let space_to_world_matrix = from.map_or(Mat4::IDENTITY, |from| from.global_transform()); let world_to_space_matrix = to.map_or(Mat4::IDENTITY, |to| to.global_transform().inverse()); @@ -89,7 +87,6 @@ impl Spatial { } // the output bounds are probably way bigger than they need to be - #[instrument(level = "debug")] pub fn get_bounding_box(&self) -> Bounds { let Some(node) = self.node() else {return Bounds::default()}; let mut bounds = self @@ -107,7 +104,6 @@ impl Spatial { bounds } - #[instrument(level = "debug", skip_all)] pub fn local_transform(&self) -> Mat4 { *self.transform.lock() } @@ -117,11 +113,9 @@ impl Spatial { None => *self.transform.lock(), } } - #[instrument] pub fn set_local_transform(&self, transform: Mat4) { *self.transform.lock() = transform; } - #[instrument(level = "debug", skip(self, reference_space))] pub fn set_local_transform_components( &self, reference_space: Option<&Spatial>, @@ -165,7 +159,6 @@ impl Spatial { ); } - #[instrument(level = "debug", skip_all)] pub fn is_ancestor_of(&self, spatial: Arc) -> bool { let mut current_ancestor = spatial; loop { @@ -197,7 +190,6 @@ impl Spatial { *self.parent.lock() = new_parent; } - #[instrument(level = "debug", skip_all)] pub fn set_spatial_parent(&self, parent: Option>) -> Result<()> { let is_ancestor = parent .as_ref() @@ -211,7 +203,6 @@ impl Spatial { Ok(()) } - #[instrument(level = "debug", skip_all)] pub fn set_spatial_parent_in_place(&self, parent: Option>) -> Result<()> { let is_ancestor = parent .as_ref() @@ -437,7 +428,6 @@ impl Spatial { }); } - #[instrument] pub(self) fn zone_distance(&self) -> f32 { self.zone .lock() diff --git a/src/objects/input/eye_pointer.rs b/src/objects/input/eye_pointer.rs index 61bf7b5..442203b 100644 --- a/src/objects/input/eye_pointer.rs +++ b/src/objects/input/eye_pointer.rs @@ -13,7 +13,6 @@ use serde::Serialize; use stardust_xr::schemas::{flat::Datamap, flex::flexbuffers}; use std::sync::Arc; use stereokit::StereoKitMultiThread; -use tracing::instrument; #[derive(Debug, Clone, Serialize)] pub struct KeyboardEvent { @@ -36,7 +35,6 @@ impl EyePointer { Ok(EyePointer { spatial, pointer }) } - #[instrument(level = "debug", name = "Update Flatscreen Pointer Ray", skip_all)] pub fn update(&self, sk: &impl StereoKitMultiThread) { let ray = sk.input_eyes(); self.spatial diff --git a/src/objects/input/mouse_pointer.rs b/src/objects/input/mouse_pointer.rs index 4e39e3f..cdadf4c 100644 --- a/src/objects/input/mouse_pointer.rs +++ b/src/objects/input/mouse_pointer.rs @@ -14,7 +14,6 @@ use nanoid::nanoid; use serde::{Deserialize, Serialize}; use std::{convert::TryFrom, sync::Arc}; use stereokit::{ray_from_mouse, ButtonState, Key, StereoKitMultiThread}; -use tracing::instrument; use xkbcommon::xkb::{Context, Keymap, FORMAT_TEXT_V1}; #[derive(Default, Deserialize, Serialize)] @@ -77,7 +76,6 @@ impl MousePointer { keyboard_sender, }) } - #[instrument(level = "debug", name = "Update Flatscreen Pointer Ray", skip_all)] pub fn update(&mut self, sk: &impl StereoKitMultiThread) { let mouse = sk.input_mouse(); diff --git a/src/objects/input/sk_controller.rs b/src/objects/input/sk_controller.rs index f6420ce..2658861 100644 --- a/src/objects/input/sk_controller.rs +++ b/src/objects/input/sk_controller.rs @@ -14,7 +14,6 @@ use stereokit::{ named_colors::WHITE, ButtonState, Handed, Model, RenderLayer, StereoKitDraw, StereoKitMultiThread, }; -use tracing::instrument; #[derive(Default, Deserialize, Serialize)] struct ControllerDatamap { @@ -55,7 +54,6 @@ impl SkController { datamap: Default::default(), }) } - #[instrument(level = "debug", name = "Update StereoKit Tip Input Method", skip_all)] pub fn update(&mut self, sk: &impl StereoKitDraw) { let controller = sk.input_controller(self.handed); *self.input.enabled.lock() = controller.tracked.contains(ButtonState::ACTIVE); diff --git a/src/objects/input/sk_hand.rs b/src/objects/input/sk_hand.rs index 9f848d5..8669830 100644 --- a/src/objects/input/sk_hand.rs +++ b/src/objects/input/sk_hand.rs @@ -13,7 +13,6 @@ use serde::{Deserialize, Serialize}; use stardust_xr::schemas::flat::{Hand as FlatHand, Joint}; use std::sync::Arc; use stereokit::{ButtonState, HandJoint, Handed, StereoKitMultiThread}; -use tracing::instrument; fn convert_joint(joint: HandJoint) -> Joint { Joint { @@ -54,7 +53,6 @@ impl SkHand { datamap: Default::default(), }) } - #[instrument(level = "debug", name = "Update Hand Input Method", skip_all)] pub fn update(&mut self, controller_enabled: bool, sk: &impl StereoKitMultiThread) { let sk_hand = sk.input_hand(self.handed); if let InputType::Hand(hand) = &mut *self.input.specialization.lock() {