bevy/crates/bevy_pbr/src
Patrick Walton fc7705c0a6 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 23:43:09 +02:00
..
atmosphere Web support for atmosphere (#18582) 2025-04-09 00:21:41 +02:00
cluster Rename bevy_platform_support to bevy_platform (#18813) 2025-04-14 22:45:27 +02:00
decal Rename bevy_platform_support to bevy_platform (#18813) 2025-04-14 22:45:27 +02:00
deferred Add required shader defs for environment map binding arrays in deferred (#18634) 2025-03-31 22:33:27 +02:00
light Fix newline in PointLightShadowMap comment (#18791) 2025-04-10 22:29:10 +02:00
light_probe Rename bevy_platform_support to bevy_platform (#18813) 2025-04-14 22:45:27 +02:00
lightmap Rename bevy_platform_support to bevy_platform (#18813) 2025-04-14 22:45:27 +02:00
meshlet Fix the ordering of the systems introduced in #18734. (#18825) 2025-04-14 23:43:09 +02:00
prepass Make sure the mesh actually exists before we try to specialize. (#18836) 2025-04-14 22:45:49 +02:00
render Fix the ordering of the systems introduced in #18734. (#18825) 2025-04-14 23:43:09 +02:00
ssao bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +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 10:24:00 +02:00
extended_material.rs Rename bevy_platform_support to bevy_platform (#18813) 2025-04-14 22:45:27 +02: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 23:43:09 +02:00
material_bind_groups.rs Rename bevy_platform_support to bevy_platform (#18813) 2025-04-14 22:45:27 +02:00
material.rs Fix the ordering of the systems introduced in #18734. (#18825) 2025-04-14 23:43:09 +02: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-10 01:19:34 +02:00
wireframe.rs Make sure the mesh actually exists before we try to specialize. (#18836) 2025-04-14 22:45:49 +02:00