mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 12:43:34 +00:00
8d19045d2f
# Objective Speed up animation by leveraging all threads in `ComputeTaskPool`. ## Solution This PR parallelizes animation sampling across all threads. To ensure that this is safely done, all animation is predicated with an ancestor query to ensure that there is no conflicting `AnimationPlayer` above each animated hierarchy that may cause this to alias. Unlike the RFC, this does not add support for reflect based "animate anything", but only extends the existing `AnimationPlayer` to support high numbers of animated characters on screen at once. ## Performance This cuts `many_foxes`'s frame time on my machine by a full millisecond, from 7.49ms to 6.5ms. (yellow is this PR, red is main). ![image](https://user-images.githubusercontent.com/3137680/204219698-ffe0136c-5e9b-436f-b8d9-b23f0b8d7d36.png) --- ## Changelog Changed: Animation sampling now runs fully multi-threaded using threads from `ComputeTaskPool`. Changed: `AnimationPlayer` that are on a child or descendant of another entity with another player will no longer be run. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |