diff options
Diffstat (limited to '')
-rw-r--r-- | examples/integration_wgpu/Cargo.toml | 1 | ||||
-rw-r--r-- | examples/integration_wgpu/src/main.rs | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/examples/integration_wgpu/Cargo.toml b/examples/integration_wgpu/Cargo.toml index eaa1df7e..9380f659 100644 --- a/examples/integration_wgpu/Cargo.toml +++ b/examples/integration_wgpu/Cargo.toml @@ -8,6 +8,7 @@ publish = false [dependencies] iced_winit = { path = "../../winit" } iced_wgpu = { path = "../../wgpu", features = ["webgl"] } +iced_profiling = { path = "../../profiling", features = ["tracing-chrome"]} env_logger = "0.8" [target.'cfg(target_arch = "wasm32")'.dependencies] diff --git a/examples/integration_wgpu/src/main.rs b/examples/integration_wgpu/src/main.rs index 70f9a48b..e3dfb6fc 100644 --- a/examples/integration_wgpu/src/main.rs +++ b/examples/integration_wgpu/src/main.rs @@ -16,6 +16,8 @@ use winit::{ event_loop::{ControlFlow, EventLoop}, }; +use iced_profiling::info_span; + #[cfg(target_arch = "wasm32")] use wasm_bindgen::JsCast; #[cfg(target_arch = "wasm32")] @@ -39,6 +41,9 @@ pub fn main() { #[cfg(not(target_arch = "wasm32"))] env_logger::init(); + // Initialize tracing + let _guard = iced_profiling::init(); + // Initialize winit let event_loop = EventLoop::new(); @@ -198,6 +203,8 @@ pub fn main() { } } Event::RedrawRequested(_) => { + let _ = info_span!("Integration_WGPU", "DRAW").entered(); + if resized { let size = window.inner_size(); |