-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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 by Bors] - Remove ExclusiveSystemParam::apply
#7489
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JoJoJet
added
A-ECS
Entities, components, systems, and events
M-Needs-Migration-Guide
A breaking change to Bevy's public API that needs to be noted in a migration guide
X-Controversial
There is active debate or serious implications around merging this PR
labels
Feb 3, 2023
I'm in favor of removing this footgun. |
alice-i-cecile
approved these changes
Feb 3, 2023
cart
approved these changes
Feb 4, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good call
bors r+ |
bors bot
pushed a commit
that referenced
this pull request
Feb 4, 2023
# Objective The trait method `SystemParam::apply` allows a `SystemParam` type to defer world mutations, which is internally used to apply `Commands` at the end of the stage. Any operations that require `&mut World` access must be deferred in this way, since parallel systems do not have exclusive access to the world. The `ExclusiveSystemParam` trait (added in #6083) has an `apply` method which serves the same purpose. However, deferring mutations in this way does not make sense for exclusive systems since they already have `&mut World` access: there is no need to wait until a hard sync point, as the system *is* a hard sync point. World mutations can and should be performed within the body of the system. ## Solution Remove the method. There were no implementations of this method in the engine. --- ## Changelog *Note for maintainers: this changelog makes more sense if it's placed above the one for #6919.* - Removed the method `ExclusiveSystemParamState::apply`. ## Migration Guide *Note for maintainers: this migration guide makes more sense if it's placed above the one for #6919.* The trait method `ExclusiveSystemParamState::apply` has been removed. If you have an exclusive system with buffers that must be applied, you should apply them within the body of the exclusive system.
Pull request successfully merged into main. Build succeeded:
|
bors
bot
changed the title
Remove
[Merged by Bors] - Remove Feb 4, 2023
ExclusiveSystemParam::apply
ExclusiveSystemParam::apply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-ECS
Entities, components, systems, and events
M-Needs-Migration-Guide
A breaking change to Bevy's public API that needs to be noted in a migration guide
X-Controversial
There is active debate or serious implications around merging this PR
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
The trait method
SystemParam::apply
allows aSystemParam
type to defer world mutations, which is internally used to applyCommands
at the end of the stage. Any operations that require&mut World
access must be deferred in this way, since parallel systems do not have exclusive access to the world.The
ExclusiveSystemParam
trait (added in #6083) has anapply
method which serves the same purpose. However, deferring mutations in this way does not make sense for exclusive systems since they already have&mut World
access: there is no need to wait until a hard sync point, as the system is a hard sync point. World mutations can and should be performed within the body of the system.Solution
Remove the method. There were no implementations of this method in the engine.
Changelog
Note for maintainers: this changelog makes more sense if it's placed above the one for #6919.
ExclusiveSystemParamState::apply
.Migration Guide
Note for maintainers: this migration guide makes more sense if it's placed above the one for #6919.
The trait method
ExclusiveSystemParamState::apply
has been removed. If you have an exclusive system with buffers that must be applied, you should apply them within the body of the exclusive system.