Don't auto insert on the extract schedule (#11669)

# Objective

- In #9822 I forgot to disable auto sync points on the Extract Schedule.
We want to do this because the Commands on the Extract Schedule should
be applied on the render thread.
This commit is contained in:
Mike 2024-02-02 21:04:57 -08:00 committed by GitHub
parent c55a5ba40b
commit a919cb0a17
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -43,6 +43,8 @@ pub mod prelude {
}; };
} }
use bevy_ecs::schedule::ScheduleBuildSettings;
use bevy_utils::prelude::default;
pub use extract_param::Extract; pub use extract_param::Extract;
use bevy_hierarchy::ValidParentCheckPlugin; use bevy_hierarchy::ValidParentCheckPlugin;
@ -388,6 +390,12 @@ unsafe fn initialize_render_app(app: &mut App) {
render_app.main_schedule_label = Render.intern(); render_app.main_schedule_label = Render.intern();
let mut extract_schedule = Schedule::new(ExtractSchedule); let mut extract_schedule = Schedule::new(ExtractSchedule);
// We skip applying any commands during the ExtractSchedule
// so commands can be applied on the render thread.
extract_schedule.set_build_settings(ScheduleBuildSettings {
auto_insert_apply_deferred: false,
..default()
});
extract_schedule.set_apply_final_deferred(false); extract_schedule.set_apply_final_deferred(false);
render_app render_app