-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Column change detection for immutable components #18788
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
base: main
Are you sure you want to change the base?
Conversation
Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke! If it's expected, please add the M-Deliberate-Rendering-Change label. If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it. |
It looks like your PR has been selected for a highlight in the next release blog post, but you didn't provide a release note. Please review the instructions for writing release notes, then expand or revise the content in the release notes directory to showcase your changes. |
|
Objective
Query<(), Changed<SomeImmutableComponent>>
Solution
Column
/ThinColumn
.Change tick will be updated when inserting, replacing or removing elements. Updating when removing seems unnecessary because change detection doesn't detect removal. I am still updating it because I want to use this somehow to help implement. Change tick will be update when inserting or replacing elements.query.is_changed()
. We may consider introducing a separate tick for removal in the future.Testing
archetype_filter_fetch
Query<Entity, Changed<T>>
. You can reproduce this by runningcargo bench -p benches --bench ecs -- --save-baseline current none_changed_detection
andcritcmp benches current -g '^(none_changed_detection/\d+\w+::\w+::[A-Z][a-z]+)'
Future work
changed_ticks
for immutable component. Because it can't be mutated, useadded_ticks
for is enough.