Fix cpu culling with size of 0
@@ -67,7 +67,14 @@ pub(crate) async fn run<TD>(
let view_proj = camera.view_proj();
// TODO: real thread count
- let chunks = object_manager.values().cloned().chunks(object_count as usize / 8);
+ let threads = 8;
+ // Want chunks of no smaller than 1 to not trigger assert in chunks.
+ let chunks = ((object_count + threads - 1) / threads).max(1);
+
+ let chunks = object_manager
+ .values()
+ .cloned()
+ .chunks((object_count as usize / 8).max(1));
let mut res_futures = FuturesUnordered::new();
for object_chunk in (&chunks).into_iter().map(|v| v.collect_vec()) {
