Skip to content

Commit 3b23aa0

Browse files
authored
Fix prepass batch (#13943)
# Objective - After #11804 , The queue_prepass_material_meshes function is now executed in parallel with other queue_* systems. This optimization introduced a potential issue where mesh_instance.should_batch() could return false in queue_prepass_material_meshes due to an unset material_bind_group_id.
1 parent 36c6f29 commit 3b23aa0

File tree

1 file changed

+3
-0
lines changed
  • crates/bevy_pbr/src/prepass

1 file changed

+3
-0
lines changed

crates/bevy_pbr/src/prepass/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,9 @@ pub fn queue_prepass_material_meshes<M: Material>(
851851
}
852852
};
853853

854+
mesh_instance
855+
.material_bind_group_id
856+
.set(material.get_bind_group_id());
854857
match mesh_key
855858
.intersection(MeshPipelineKey::BLEND_RESERVED_BITS | MeshPipelineKey::MAY_DISCARD)
856859
{

0 commit comments

Comments
 (0)