diff --git a/blade-graphics/src/gles/command.rs b/blade-graphics/src/gles/command.rs index 956f5d5..e178159 100644 --- a/blade-graphics/src/gles/command.rs +++ b/blade-graphics/src/gles/command.rs @@ -145,7 +145,7 @@ impl super::CommandEncoder { ); } let time = Duration::from_nanos(result - prev); - *self.timings.entry(pass_name).or_default() += time; + self.timings.push((pass_name, time)); prev = result } } diff --git a/blade-graphics/src/lib.rs b/blade-graphics/src/lib.rs index 2683086..a85450e 100644 --- a/blade-graphics/src/lib.rs +++ b/blade-graphics/src/lib.rs @@ -1150,4 +1150,4 @@ pub struct Viewport { pub depth: std::ops::Range, } -pub type Timings = std::collections::HashMap; +pub type Timings = Vec<(String, std::time::Duration)>; diff --git a/blade-graphics/src/metal/command.rs b/blade-graphics/src/metal/command.rs index 6aa344e..d6ae1c9 100644 --- a/blade-graphics/src/metal/command.rs +++ b/blade-graphics/src/metal/command.rs @@ -333,7 +333,7 @@ impl crate::traits::CommandEncoder for super::CommandEncoder { }; for (name, chunk) in td.pass_names.drain(..).zip(counters.chunks(2)) { let duration = Duration::from_nanos(chunk[1] - chunk[0]); - *self.timings.entry(name).or_default() += duration; + self.timings.push((name, duration)); } } } diff --git a/blade-graphics/src/vulkan/command.rs b/blade-graphics/src/vulkan/command.rs index c49e608..1d1753f 100644 --- a/blade-graphics/src/vulkan/command.rs +++ b/blade-graphics/src/vulkan/command.rs @@ -497,7 +497,7 @@ impl crate::traits::CommandEncoder for super::CommandEncoder { { let diff = (ts - prev) as f32 * timing.period; prev = ts; - *self.timings.entry(name).or_default() += Duration::from_nanos(diff as _); + self.timings.push((name, Duration::from_nanos(diff as _))); } } unsafe {