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

[Merged by Bors] - [assets] fix Assets being set as 'changed' each frame #2280

Closed

Conversation

NathanSWard
Copy link
Contributor

@NathanSWard NathanSWard commented May 30, 2021

Objective

Solution

  • Only have Assets change detection be triggered when the collection is actually modified.
  • This includes utilizing ResMut further down the stack instead of a &mut Assets directly.

@NathanSWard NathanSWard added A-Assets Load files from disk to use for things like images, models, and sounds C-Bug An unexpected or incorrect behavior labels May 30, 2021
@NathanSWard NathanSWard changed the title [assets] fix Assets being set a 'changed' each frame [assets] fix Assets being set as 'changed' each frame May 30, 2021
@NathanSWard NathanSWard 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 May 31, 2021
@cart
Copy link
Member

cart commented Jun 2, 2021

bors r+

bors bot pushed a commit that referenced this pull request Jun 2, 2021
## Objective
- Fixes: #2275 
- `Assets` were being flagged as 'changed' each frame regardless of if the assets were actually being updated. 

## Solution
- Only have `Assets` change detection be triggered when the collection is actually modified. 
- This includes utilizing `ResMut` further down the stack instead of a `&mut Assets` directly.
@bors bors bot changed the title [assets] fix Assets being set as 'changed' each frame [Merged by Bors] - [assets] fix Assets being set as 'changed' each frame Jun 2, 2021
@bors bors bot closed this Jun 2, 2021
ostwilkens pushed a commit to ostwilkens/bevy that referenced this pull request Jul 27, 2021
## Objective
- Fixes: bevyengine#2275 
- `Assets` were being flagged as 'changed' each frame regardless of if the assets were actually being updated. 

## Solution
- Only have `Assets` change detection be triggered when the collection is actually modified. 
- This includes utilizing `ResMut` further down the stack instead of a `&mut Assets` directly.
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-Bug An unexpected or incorrect behavior 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.

Res<Assets<T>>.is_changed() is true every frame, even when not changed
4 participants