Skip to content

Commit

Permalink
change to ordered timings over hashmap
Browse files Browse the repository at this point in the history
  • Loading branch information
EriKWDev authored and kvark committed Dec 25, 2024
1 parent 091a840 commit 1b51f28
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion blade-graphics/src/gles/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
2 changes: 1 addition & 1 deletion blade-graphics/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1150,4 +1150,4 @@ pub struct Viewport {
pub depth: std::ops::Range<f32>,
}

pub type Timings = std::collections::HashMap<String, std::time::Duration>;
pub type Timings = Vec<(String, std::time::Duration)>;
2 changes: 1 addition & 1 deletion blade-graphics/src/metal/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion blade-graphics/src/vulkan/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 1b51f28

Please sign in to comment.