bevy/crates/bevy_pbr/src
Patrick Walton 56784de769
Fix the ordering of the systems introduced in #18734. (#18825)
There's still a race resulting in blank materials whenever a material of
type A is added on the same frame that a material of type B is removed.
PR #18734 improved the situation, but ultimately didn't fix the race
because of two issues:

1. The `late_sweep_material_instances` system was never scheduled. This
PR fixes the problem by scheduling that system.

2. `early_sweep_material_instances` needs to be called after *every*
material type has been extracted, not just when the material of *that*
type has been extracted. The `chain()` added during the review process
in PR #18734 broke this logic. This PR reverts that and fixes the
ordering by introducing a new `SystemSet` that contains all material
extraction systems.

I also took the opportunity to switch a manual reference to
`AssetId::<StandardMaterial>::invalid()` to the new
`DUMMY_MESH_MATERIAL` constant for clarity.

Because this is a bug that can affect any application that switches
material types in a single frame, I think this should be uplifted to
Bevy 0.16.
2025-04-14 21:17:48 +00:00
..
atmosphere Web support for atmosphere (#18582) 2025-04-06 20:06:55 +00:00
cluster Rename bevy_platform_support to bevy_platform (#18813) 2025-04-11 23:13:28 +00:00
decal Rename bevy_platform_support to bevy_platform (#18813) 2025-04-11 23:13:28 +00:00
deferred Add required shader defs for environment map binding arrays in deferred (#18634) 2025-03-31 18:07:54 +00:00
light Fix newline in PointLightShadowMap comment (#18791) 2025-04-10 18:05:11 +00:00
light_probe Rename bevy_platform_support to bevy_platform (#18813) 2025-04-11 23:13:28 +00:00
lightmap Rename bevy_platform_support to bevy_platform (#18813) 2025-04-11 23:13:28 +00:00
meshlet Fix the ordering of the systems introduced in #18734. (#18825) 2025-04-14 21:17:48 +00:00
prepass Make sure the mesh actually exists before we try to specialize. (#18836) 2025-04-14 19:09:02 +00:00
render Fix the ordering of the systems introduced in #18734. (#18825) 2025-04-14 21:17:48 +00:00
ssao Add bevy_anti_aliasing (#18323) 2025-03-19 18:40:32 +00:00
ssr bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00
volumetric_fog bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00
components.rs reexport entity set collections in entity module (#18413) 2025-03-30 03:51:14 +00:00
extended_material.rs Rename bevy_platform_support to bevy_platform (#18813) 2025-04-11 23:13:28 +00:00
fog.rs bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00
lib.rs Fix the ordering of the systems introduced in #18734. (#18825) 2025-04-14 21:17:48 +00:00
material_bind_groups.rs Rename bevy_platform_support to bevy_platform (#18813) 2025-04-11 23:13:28 +00:00
material.rs Fix the ordering of the systems introduced in #18734. (#18825) 2025-04-14 21:17:48 +00:00
mesh_material.rs bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00
parallax.rs bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00
pbr_material.rs Make the StandardMaterial bindless index table have a fixed size regardless of the features that are enabled. (#18771) 2025-04-09 20:39:42 +00:00
wireframe.rs Make sure the mesh actually exists before we try to specialize. (#18836) 2025-04-14 19:09:02 +00:00