Skip to content

Commit

Permalink
Cleanup render schedule (bevyengine#7589)
Browse files Browse the repository at this point in the history
# Objective

- Fixes bevyengine#7531

## Solution

- Add systems to prepare set
- Also remove a unnecessary apply_systems_buffers from ExtractCommands set.
  • Loading branch information
hymm authored and myreprise1 committed Feb 15, 2023
1 parent 19a8493 commit bf60a89
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions crates/bevy_pbr/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
)
Expand Down
6 changes: 5 additions & 1 deletion crates/bevy_pbr/src/material.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,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));
}

Expand Down
1 change: 0 additions & 1 deletion crates/bevy_render/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,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));
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_sprite/src/mesh2d/material.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,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));
}
Expand Down

0 comments on commit bf60a89

Please sign in to comment.