Enable skipping/running SystemSets during Stepping #13219
+230
−26
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Objective
app::run_system_set()
function #12717run_schedule()
function but nothing more specificWorld::run_system_set
to run only the systems in aSystemSet
#12726, but the solution wasn't very elegantSolution
Instead, I think it's possible to extend the existing system stepping machinery to achieve what I want. It should not be a problem to require system-stepping since
run_system_set()
would mostly be used inside tests.As a bonus, the new solution provides more control, since it's possible to run all the systems in a set except for one, etc.
Add functions in SystemStepping to be able to add SystemStepping instructions (
AlwaysRun
,NeverRun
) for an entireSystemSet
. In those cases, system-stepping will issue instructions for every system that is contained inside theSet
.For ease of computation I had to add a variable
sets_to_systems
in theScheduleGraph
(which is gated behind the system-stepping feature), but it's requiring a lot of#[cfg(feature(bevy_debug_stepping))]
statements elsewhere in the code. I wonder if there's a better solution?Testing
Changelog
Added
Extended SystemStepping to be able to Skip/Step-through all the systems of a SystemSet