Skip to content

Add RenderSet::FinalCleanup for World::clear_entities #14764

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions crates/bevy_render/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ pub struct RenderPlugin {

/// The systems sets of the default [`App`] rendering schedule.
///
/// that runs immediately after the matching system set.
/// These can be useful for ordering, but you almost never want to add your systems to these sets.
#[derive(Debug, Hash, PartialEq, Eq, Clone, SystemSet)]
pub enum RenderSet {
Expand Down Expand Up @@ -138,6 +137,10 @@ pub enum RenderSet {
Render,
/// Cleanup render resources here.
Cleanup,
/// Final cleanup occurs: all entities will be despawned.
///
/// Runs after [`Cleanup`](RenderSet::Cleanup).
PostCleanup,
}

/// The main render schedule.
Expand All @@ -162,6 +165,7 @@ impl Render {
Prepare,
Render,
Cleanup,
PostCleanup,
)
.chain(),
);
Expand Down Expand Up @@ -469,7 +473,7 @@ unsafe fn initialize_render_app(app: &mut App) {
render_system,
)
.in_set(RenderSet::Render),
World::clear_entities.in_set(RenderSet::Cleanup),
World::clear_entities.in_set(RenderSet::PostCleanup),
),
);

Expand Down