From 68e5b53c43dbc62eb2dcabd42d9cebe29f91f844 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Wed, 26 Jun 2024 01:31:25 +0200 Subject: [PATCH] give non mesh things their own bin --- crates/bevy_pbr/src/render/mesh.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/crates/bevy_pbr/src/render/mesh.rs b/crates/bevy_pbr/src/render/mesh.rs index 299b719f7b4b5..8623505dd7642 100644 --- a/crates/bevy_pbr/src/render/mesh.rs +++ b/crates/bevy_pbr/src/render/mesh.rs @@ -1309,9 +1309,13 @@ impl GetFullBatchData for MeshPipeline { return None; }; - mesh_instances - .get(&entity) - .map(|entity| entity.current_uniform_index) + Some( + mesh_instances + .get(&entity) + .map(|entity| entity.current_uniform_index) + // When not found, return the maximum value. This entity likely doesn't have a mesh but should still be drawn + .unwrap_or(NonMaxU32::MAX), + ) } fn get_batch_indirect_parameters_index(