mirror of
https://github.com/bevyengine/bevy
synced 2024-09-21 06:52:04 +00:00
63d89d31ba
# Objective Fixes #8284. `values` is being pushed to separately from the actual scratch buffer in `DynamicUniformBuffer::push` and `DynamicStorageBuffer::push`. In both types, `values` is really only used to track the number of elements being added to the buffer, yet is causing extra allocations, size increments and excess copies. ## Solution Remove it and its remaining uses. Replace it with accesses to `scratch` instead. I removed the `len` accessor, as it may be non-trivial to compute just from `scratch`. If this is still desirable to have, we can keep a `len` member field to track it instead of relying on `scratch`. |
||
---|---|---|
.. | ||
macros | ||
src | ||
Cargo.toml |