diff options
author | 2022-11-29 19:50:58 -0800 | |
---|---|---|
committer | 2023-01-09 18:52:38 +0100 | |
commit | c5cd236b7380c3689792934aeaecd2942713fa67 (patch) | |
tree | c27a0e6ecfdec7936791ee70e07ce19c713095cd /wgpu/src/quad.rs | |
parent | ba20ac8e49aedfa9d822d71784587d0635cec4f8 (diff) | |
download | iced-c5cd236b7380c3689792934aeaecd2942713fa67.tar.gz iced-c5cd236b7380c3689792934aeaecd2942713fa67.tar.bz2 iced-c5cd236b7380c3689792934aeaecd2942713fa67.zip |
Initial profiling support for Iced.
Diffstat (limited to 'wgpu/src/quad.rs')
-rw-r--r-- | wgpu/src/quad.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/wgpu/src/quad.rs b/wgpu/src/quad.rs index 027a34be..702122e1 100644 --- a/wgpu/src/quad.rs +++ b/wgpu/src/quad.rs @@ -6,6 +6,9 @@ use bytemuck::{Pod, Zeroable}; use std::mem; use wgpu::util::DeviceExt; +#[cfg(feature = "trace")] +use iced_profiling::info_span; + #[derive(Debug)] pub struct Pipeline { pipeline: wgpu::RenderPipeline, @@ -173,6 +176,9 @@ impl Pipeline { bounds: Rectangle<u32>, target: &wgpu::TextureView, ) { + #[cfg(feature = "trace")] + let _ = info_span!("Wgpu::Quad", "DRAW").entered(); + let uniforms = Uniforms::new(transformation, scale); { @@ -207,6 +213,9 @@ impl Pipeline { instance_buffer.copy_from_slice(instance_bytes); + #[cfg(feature = "trace")] + let _ = info_span!("Wgpu::Quad", "BEGIN_RENDER_PASS").enter(); + { let mut render_pass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor { |