summaryrefslogtreecommitdiffstats
path: root/wgpu/src/triangle.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2023-01-09 19:10:45 +0100
committerLibravatar GitHub <noreply@github.com>2023-01-09 19:10:45 +0100
commit07d755c6a270bd46fe9752ed57b3ceaddda1f081 (patch)
treecbd8f75d8cd6beeb3c04cbedc0127f2e17b70f56 /wgpu/src/triangle.rs
parentba20ac8e49aedfa9d822d71784587d0635cec4f8 (diff)
parent2e5dc1f37a32e1f3aaa6db2aa9cf9c95e83bff42 (diff)
downloadiced-07d755c6a270bd46fe9752ed57b3ceaddda1f081.tar.gz
iced-07d755c6a270bd46fe9752ed57b3ceaddda1f081.tar.bz2
iced-07d755c6a270bd46fe9752ed57b3ceaddda1f081.zip
Merge pull request #1565 from bungoboingo/feat/tracing
[Feature] Profiling
Diffstat (limited to '')
-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..efdd214b 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 = "tracing")]
+use tracing::info_span;
#[derive(Debug)]
pub struct Pipeline {
@@ -53,6 +55,9 @@ impl Pipeline {
scale_factor: f32,
meshes: &[Mesh<'_>],
) {
+ #[cfg(feature = "tracing")]
+ 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 = "tracing")]
+ 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"),