Initial profiling support for Iced.
This commit is contained in:
parent
ba20ac8e49
commit
c5cd236b73
20 changed files with 357 additions and 35 deletions
|
|
@ -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]
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue