Skip to content

Commit

Permalink
Fix prepass batch (#13943)
Browse files Browse the repository at this point in the history
# 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.
  • Loading branch information
re0312 authored Jul 14, 2024
1 parent 36c6f29 commit 3b23aa0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/bevy_pbr/src/prepass/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,9 @@ pub fn queue_prepass_material_meshes<M: Material>(
}
};

mesh_instance
.material_bind_group_id
.set(material.get_bind_group_id());
match mesh_key
.intersection(MeshPipelineKey::BLEND_RESERVED_BITS | MeshPipelineKey::MAY_DISCARD)
{
Expand Down

0 comments on commit 3b23aa0

Please sign in to comment.