debug: Better frame graph

This commit is contained in:
Victoria Brekenfeld 2022-11-18 17:20:52 +01:00
parent 9823b42c20
commit 36cb2ac719
6 changed files with 215 additions and 72 deletions

View file

@ -252,12 +252,17 @@ where
.map(Into::into),
);
#[cfg(feature = "debug")]
if let Some(fps) = fps.as_mut() {
fps.elements();
}
renderer.bind(target).map_err(RenderError::Rendering)?;
let res = damage_tracker.render_output(renderer, age, &elements, CLEAR_COLOR, None);
#[cfg(feature = "debug")]
if let Some(fps) = fps.as_mut() {
fps.end();
fps.render();
}
if let Some((source, buffers)) = screencopy {
@ -303,6 +308,10 @@ where
}
}
}
#[cfg(feature = "debug")]
if let Some(fps) = fps.as_mut() {
fps.screencopy();
}
}
res