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

@ -21,6 +21,9 @@ use glow::HasContext;
use std::cell::RefCell;
#[cfg(feature = "trace")]
use iced_profiling::info_span;
#[derive(Debug)]
pub(crate) struct Pipeline {
program: <glow::Context as HasContext>::Program,
@ -148,6 +151,9 @@ impl Pipeline {
images: &[layer::Image],
layer_bounds: Rectangle<u32>,
) {
#[cfg(feature = "trace")]
let _ = info_span!("Glow::Image", "DRAW").entered();
unsafe {
gl.use_program(Some(self.program));
gl.bind_vertex_array(Some(self.vertex_array));