diff --git a/crates/bevy_pbr/src/prepass/mod.rs b/crates/bevy_pbr/src/prepass/mod.rs index 6e89575bb6..61afa1d0e4 100644 --- a/crates/bevy_pbr/src/prepass/mod.rs +++ b/crates/bevy_pbr/src/prepass/mod.rs @@ -891,18 +891,26 @@ pub fn queue_prepass_material_meshes( render_mesh_instances: Res, render_materials: Res>, render_material_instances: Res>, - mut views: Query<( - &ExtractedView, - &VisibleEntities, - &mut RenderPhase, - &mut RenderPhase, - Option<&mut RenderPhase>, - Option<&mut RenderPhase>, - Option<&DepthPrepass>, - Option<&NormalPrepass>, - Option<&MotionVectorPrepass>, - Option<&DeferredPrepass>, - )>, + mut views: Query< + ( + &ExtractedView, + &VisibleEntities, + Option<&mut RenderPhase>, + Option<&mut RenderPhase>, + Option<&mut RenderPhase>, + Option<&mut RenderPhase>, + Option<&DepthPrepass>, + Option<&NormalPrepass>, + Option<&MotionVectorPrepass>, + Option<&DeferredPrepass>, + ), + Or<( + With>, + With>, + With>, + With>, + )>, + >, ) where M::Data: PartialEq + Eq + Hash + Clone, { @@ -1027,7 +1035,7 @@ pub fn queue_prepass_material_meshes( dynamic_offset: None, }); } else { - opaque_phase.add(Opaque3dPrepass { + opaque_phase.as_mut().unwrap().add(Opaque3dPrepass { entity: *visible_entity, draw_function: opaque_draw_prepass, pipeline_id, @@ -1051,7 +1059,7 @@ pub fn queue_prepass_material_meshes( dynamic_offset: None, }); } else { - alpha_mask_phase.add(AlphaMask3dPrepass { + alpha_mask_phase.as_mut().unwrap().add(AlphaMask3dPrepass { entity: *visible_entity, draw_function: alpha_mask_draw_prepass, pipeline_id,