Skip to content
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

Remove the UpdateAssets and AssetEvents schedules #11986

Merged
merged 3 commits into from
Feb 26, 2024

Conversation

james7132
Copy link
Member

@james7132 james7132 commented Feb 20, 2024

Objective

Fix #11845.

Solution

Remove the UpdateAssets and AssetEvents schedules. Moved the UpdateAssets systems to PreUpdate, and AssetEvents systems into First. The former is meant to run before any of the event flushes.

Future Work

It'd be ideal if we could manually flush the events for assets to avoid needing two, sort of redundant, systems. This should at least let them potentially run in parallel with all of the systems in the schedules they were moved to.


Changelog

Removed: UpdateAssets schedule from the main schedule. All systems have been moved to PreUpdate.
Removed: AssetEvents schedule from the main schedule. All systems have been move to First with the same system sets.

Migration Guide

TODO

@james7132 james7132 added A-Assets Load files from disk to use for things like images, models, and sounds C-Code-Quality A section of code that is hard to understand or change M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide labels Feb 20, 2024
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good: I really like this as an incremental improvement.

@alice-i-cecile alice-i-cecile added this to the 0.14 milestone Feb 20, 2024
@james7132 james7132 requested a review from cart February 21, 2024 23:47
Comment on lines 419 to 427
/// Schedule where [`Assets`] resources are updated.
#[derive(Debug, Hash, PartialEq, Eq, Clone, ScheduleLabel)]
#[derive(Debug, Hash, PartialEq, Eq, Clone, SystemSet)]
pub struct UpdateAssets;

/// Schedule where events accumulated in [`Assets`] are applied to the [`AssetEvent`] [`Events`] resource.
///
/// [`Events`]: bevy_ecs::event::Events
#[derive(Debug, Hash, PartialEq, Eq, Clone, ScheduleLabel)]
#[derive(Debug, Hash, PartialEq, Eq, Clone, SystemSet)]
pub struct AssetEvents;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently unused, could be used to maybe keep backwards compatibility, but the migration should be very simple
That would mean this has to wait until 0.14 though

@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Feb 26, 2024
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Feb 26, 2024
Merged via the queue into bevyengine:main with commit 51edf9c Feb 26, 2024
25 checks passed
msvbg pushed a commit to msvbg/bevy that referenced this pull request Feb 26, 2024
# Objective
Fix bevyengine#11845.

## Solution
Remove the `UpdateAssets` and `AssetEvents` schedules. Moved the
`UpdateAssets` systems to `PreUpdate`, and `AssetEvents` systems into
`First`. The former is meant to run before any of the event flushes.

## Future Work
It'd be ideal if we could manually flush the events for assets to avoid
needing two, sort of redundant, systems. This should at least let them
potentially run in parallel with all of the systems in the schedules
they were moved to.

---

## Changelog
Removed: `UpdateAssets` schedule from the main schedule. All systems
have been moved to `PreUpdate`.
Removed: `AssetEvents` schedule from the main schedule. All systems have
been move to `First` with the same system sets.

## Migration Guide
TODO
msvbg pushed a commit to msvbg/bevy that referenced this pull request Feb 26, 2024
# Objective
Fix bevyengine#11845.

## Solution
Remove the `UpdateAssets` and `AssetEvents` schedules. Moved the
`UpdateAssets` systems to `PreUpdate`, and `AssetEvents` systems into
`First`. The former is meant to run before any of the event flushes.

## Future Work
It'd be ideal if we could manually flush the events for assets to avoid
needing two, sort of redundant, systems. This should at least let them
potentially run in parallel with all of the systems in the schedules
they were moved to.

---

## Changelog
Removed: `UpdateAssets` schedule from the main schedule. All systems
have been moved to `PreUpdate`.
Removed: `AssetEvents` schedule from the main schedule. All systems have
been move to `First` with the same system sets.

## Migration Guide
TODO
@hymm hymm mentioned this pull request Mar 9, 2024
github-merge-queue bot pushed a commit that referenced this pull request Mar 9, 2024
# Objective

- Fixes #12380

## Solution

- Before #11986 AssetEvents were scheduled after PostUpdate. That pr
moved these into First. This PR moves them into Last which is closer to
how they were scheduled before.
@james7132 james7132 deleted the remove-asset-schedules branch March 10, 2024 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Assets Load files from disk to use for things like images, models, and sounds C-Code-Quality A section of code that is hard to understand or change M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove AssetEvents and Update assets schedules
3 participants