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

@ -9,6 +9,9 @@ use iced_graphics::triangle::{ColoredVertex2D, Vertex2D};
use glow::HasContext;
use std::marker::PhantomData;
#[cfg(feature = "trace")]
use iced_profiling::info_span;
const DEFAULT_VERTICES: usize = 1_000;
const DEFAULT_INDICES: usize = 1_000;
@ -58,6 +61,9 @@ impl Pipeline {
transformation: Transformation,
scale_factor: f32,
) {
#[cfg(feature = "trace")]
let _ = info_span!("Glow::Triangle", "DRAW").enter();
unsafe {
gl.enable(glow::MULTISAMPLE);
gl.enable(glow::SCISSOR_TEST);