summaryrefslogtreecommitdiffstats
path: root/wgpu/src/triangle.rs
diff options
context:
space:
mode:
authorLibravatar Bingus <shankern@protonmail.com>2022-11-29 19:50:58 -0800
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-01-09 18:52:38 +0100
commitc5cd236b7380c3689792934aeaecd2942713fa67 (patch)
treec27a0e6ecfdec7936791ee70e07ce19c713095cd /wgpu/src/triangle.rs
parentba20ac8e49aedfa9d822d71784587d0635cec4f8 (diff)
downloadiced-c5cd236b7380c3689792934aeaecd2942713fa67.tar.gz
iced-c5cd236b7380c3689792934aeaecd2942713fa67.tar.bz2
iced-c5cd236b7380c3689792934aeaecd2942713fa67.zip
Initial profiling support for Iced.
Diffstat (limited to 'wgpu/src/triangle.rs')
-rw-r--r--wgpu/src/triangle.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/wgpu/src/triangle.rs b/wgpu/src/triangle.rs
index 061154b6..b7c63167 100644
--- a/wgpu/src/triangle.rs
+++ b/wgpu/src/triangle.rs
@@ -8,6 +8,8 @@ use crate::Transformation;
use iced_graphics::layer::mesh::{self, Mesh};
use iced_graphics::triangle::ColoredVertex2D;
use iced_graphics::Size;
+#[cfg(feature = "trace")]
+use iced_profiling::info_span;
#[derive(Debug)]
pub struct Pipeline {
@@ -53,6 +55,9 @@ impl Pipeline {
scale_factor: f32,
meshes: &[Mesh<'_>],
) {
+ #[cfg(feature = "trace")]
+ let _ = info_span!("Wgpu::Triangle", "DRAW").entered();
+
// Count the total amount of vertices & indices we need to handle
let count = mesh::attribute_count_of(meshes);
@@ -247,6 +252,9 @@ impl Pipeline {
(target, None, wgpu::LoadOp::Load)
};
+ #[cfg(feature = "trace")]
+ let _ = info_span!("Wgpu::Triangle", "BEGIN_RENDER_PASS").enter();
+
let mut render_pass =
encoder.begin_render_pass(&wgpu::RenderPassDescriptor {
label: Some("iced_wgpu::triangle render pass"),