`Main`/`Render` schedules be run at different real timing.
This pull request is stacked on #8961.
Objective
Allow the tick rate and frame rate to be configured to different values.
This PR supports the prerequisite that the Main schedule and the Render schedule be run at different real timings.
Note that tick rate and frame rate control will be implemented in a later PR.
Solution
Call SubApp::extract and SubApp::run in the exclusive system. Add that system to the Render schedule.
Moved the responsibility for running top-level schedules from App struct to the runner function. Within the runner function, call World::run_schedule to run schedules separately.
Changelog
Added
- Added
app::SubApp::main_schedule_label. - Added
app::ScheduleRunnerPlugin::main_schedule_label. - Added
winit::WinitSettings::main_schedule_label. - Added
winit::WinitSettings::render_schedule_label. - Added
app::App::update_sub_apps.
Changed
- Moved
render::Rendertoapp::Render. - Moved
render::Render::base_scheduletorender::RenderSet::base_schedule. (Back in place?) - Added
Syncbounds toapp::App::runner. - Added
Syncbounds toapp::SubApp::extract. - If only RenderPlugin is used, the
RenderAppinstance will not be accessible aftercleanup.
Removed
- Removed
render::pipelined_rendering::RenderExtractApp. - Removed
app::App::update. - Removed
app::App::main_schedule_label.
Migration Guide
The top-level schedules configuration has been moved from App to plugins for setting the runner function. See ScheduleRunnerPlugin or WinitSettings.
Replace the code that calls App::update in the runner function with the following:
app.world.run_schedule(Main);
app.world.run_schedule(Render);
app.update_sub_apps();
app.world.clear_trackers();
(The real timing for running top-level schedules has not yet been changed.)
Example no_renderer failed to run, please try running it locally and check the result.
I made a mistake and did not stack correctly on #8961, so I restored it. The force push just before can be ignored.
What's the goal of this PR? Is it to make it possible to call the the main schedule and the render schedule separately in the runner?
In terms of implementation, yes.
In terms of designs, I want to remove obstacles to good design. Current status:
- To run a render, the runner function must know details of the render plugin.
- Since the
Appstruct is responsibility for running the top-level schedule, the runner function can only be controlled indirectly from theApp.