Skip to content

Commit

Permalink
fix: CPU sort skipping logic
Browse files Browse the repository at this point in the history
  • Loading branch information
mosure committed Dec 15, 2023
1 parent 583eea2 commit 3499dd6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/sort/rayon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ pub fn rayon_sort(
}
}

*last_sort_time = Some(Instant::now());

// TODO: move sort to render world, use extracted views and update the existing buffer instead of creating new

for (
Expand All @@ -60,7 +58,6 @@ pub fn rayon_sort(
if *last_camera_position == camera_position {
return;
}
*last_camera_position = camera_position;

for (
gaussian_cloud_handle,
Expand All @@ -83,6 +80,10 @@ pub fn rayon_sort(
if let Some(sorted_entries) = sorted_entries_res.get_mut(sorted_entries_handle) {
assert_eq!(gaussian_cloud.gaussians.len(), sorted_entries.sorted.len());

*last_camera_position = camera_position;
*last_sort_time = Some(Instant::now());

// TODO: async CPU sort
gaussian_cloud.gaussians.par_iter()
.zip(sorted_entries.sorted.par_iter_mut())
.enumerate()
Expand Down

0 comments on commit 3499dd6

Please sign in to comment.