Skip to content

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

Closed
NathanSWard wants to merge 1 commit into
bevyengine:mainfrom
NathanSWard:nward/assets-set-changed-bug
Closed

NathanSWard wants to merge 1 commit into
bevyengine:mainfrom
NathanSWard:nward/assets-set-changed-bug

Conversation

@NathanSWard

@NathanSWard NathanSWard commented May 30, 2021 •

Copy link
Copy Markdown
Contributor

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.

Comment thread crates/bevy_asset/src/assets.rs
@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

cart commented Jun 2, 2021

Copy link
Copy Markdown
Member

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