Initial profiling support for Iced.

This commit is contained in:
Bingus 2022-11-29 19:50:58 -08:00 committed by Héctor Ramón Jiménez
parent ba20ac8e49
commit c5cd236b73
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
20 changed files with 357 additions and 35 deletions

View file

@ -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]

View file

@ -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();