Cleanup render schedule (#7589)

# Objective

- Fixes https://github.com/bevyengine/bevy/issues/7531

## Solution

- Add systems to prepare set
- Also remove a unnecessary apply_systems_buffers from ExtractCommands set.
This commit is contained in:
Mike 2023-02-10 03:32:54 +00:00
parent eeb67ee48d
commit cd447fb4e6
4 changed files with 8 additions and 4 deletions

View file

@ -284,6 +284,7 @@ impl Plugin for PbrPlugin {
// because prepare_lights creates new views for shadow mapping
.add_system(
apply_system_buffers
.in_set(RenderSet::Prepare)
.after(RenderLightSystems::PrepareLights)
.before(ViewSet::PrepareUniforms),
)

View file

@ -196,7 +196,11 @@ where
.init_resource::<RenderMaterials<M>>()
.init_resource::<SpecializedMeshPipelines<MaterialPipeline<M>>>()
.add_system_to_schedule(ExtractSchedule, extract_materials::<M>)
.add_system(prepare_materials::<M>.after(PrepareAssetLabel::PreAssetPrepare))
.add_system(
prepare_materials::<M>
.in_set(RenderSet::Prepare)
.after(PrepareAssetLabel::PreAssetPrepare),
)
.add_system(queue_material_meshes::<M>.in_set(RenderSet::Queue));
}

View file

@ -112,7 +112,6 @@ impl RenderSet {
let mut schedule = Schedule::new();
// Create "stage-like" structure using buffer flushes + ordering
schedule.add_system(apply_system_buffers.in_set(ExtractCommands));
schedule.add_system(apply_system_buffers.in_set(PrepareFlush));
schedule.add_system(apply_system_buffers.in_set(QueueFlush));
schedule.add_system(apply_system_buffers.in_set(PhaseSortFlush));

View file

@ -161,8 +161,8 @@ where
.add_system_to_schedule(ExtractSchedule, extract_materials_2d::<M>)
.add_system(
prepare_materials_2d::<M>
.after(PrepareAssetLabel::PreAssetPrepare)
.in_set(RenderSet::Prepare),
.in_set(RenderSet::Prepare)
.after(PrepareAssetLabel::PreAssetPrepare),
)
.add_system(queue_material2d_meshes::<M>.in_set(RenderSet::Queue));
}