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

[InstanceInputUniformBuffer::remove] could cause incorrect behaviour. #17166

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Bleachfuel
Copy link
Contributor

@Bleachfuel Bleachfuel commented Jan 5, 2025

Objective

[InstanceInputUniformBuffer::remove] could, when the wrong index was inserted overwrite data when adding it to the buffer.

Solution

make [InstanceInputUniformBuffer::remove] do some checks before removing. And having[InstanceInputUniformBuffer::remove_unchecked] for when you don't need that behaviour.

Testing

Added unit test

@Bleachfuel Bleachfuel marked this pull request as draft January 5, 2025 11:34
Copy link
Contributor

github-actions bot commented Jan 5, 2025

Your PR increases Bevy Minimum Supported Rust Version. Please update the rust-version field in the root Cargo.toml file.

@JMS55 JMS55 requested a review from pcwalton January 5, 2025 16:43
@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen C-Usability A targeted quality-of-life change that makes Bevy easier to use S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Jan 5, 2025
@Bleachfuel Bleachfuel marked this pull request as ready for review January 15, 2025 15:32
@alice-i-cecile alice-i-cecile added S-Needs-Review Needs reviewer attention (from anyone!) to move forward D-Straightforward Simple bug fixes and API improvements, docs, test and examples and removed S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Jan 15, 2025
@Bleachfuel Bleachfuel requested a review from pcwalton January 16, 2025 10:31
@pcwalton
Copy link
Contributor

Does this actually fix a bug? We should never be removing twice to begin with.

@Bleachfuel
Copy link
Contributor Author

Not really, more so a unsoundess possibility. We could also just add notes to the function. This is more if u accidentally remove twice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants