Fix specialize_shadows system ordering (#18412)

# Objective
- Fixes https://github.com/bevyengine/bevy/issues/18332

## Solution

- Move specialize_shadows to ManageViews so that it can run after
prepare_lights, so that shadow views exist for specialization.
- Unfortunately this means that specialize_shadows is no longer in
PrepareMeshes like the rest of the specialization systems.

## Testing
- Ran anti_aliasing example, switched between the different AA options,
observed no glitches.
This commit is contained in:
JMS55 2025-03-18 23:40:45 -07:00 committed by François Mockers
parent 48fc396f04
commit 62f7f2d159

View File

@ -351,9 +351,11 @@ where
Render, Render,
( (
check_views_lights_need_specialization.in_set(RenderSet::PrepareAssets), check_views_lights_need_specialization.in_set(RenderSet::PrepareAssets),
// specialize_shadows::<M> also needs to run after prepare_assets::<PreparedMaterial<M>>,
// which is fine since ManageViews is after PrepareAssets
specialize_shadows::<M> specialize_shadows::<M>
.in_set(RenderSet::PrepareMeshes) .in_set(RenderSet::ManageViews)
.after(prepare_assets::<PreparedMaterial<M>>), .after(prepare_lights),
queue_shadows::<M> queue_shadows::<M>
.in_set(RenderSet::QueueMeshes) .in_set(RenderSet::QueueMeshes)
.after(prepare_assets::<PreparedMaterial<M>>), .after(prepare_assets::<PreparedMaterial<M>>),