Initial profiling support for Iced.
This commit is contained in:
parent
ba20ac8e49
commit
c5cd236b73
20 changed files with 357 additions and 35 deletions
|
|
@ -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"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue