mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 12:43:34 +00:00
87399c3560
Fix staging buffer required size calculation (fixes #1056) The `required_staging_buffer_size` is currently calculated differently in two places, each will be correct in different situations: * `prepare_staging_buffers()` based on actual `buffer_byte_len()` * `set_required_staging_buffer_size_to_max()` based on item_size In the case of render assets, `prepare_staging_buffers()` would only operate over changed assets. If some of the assets didn't change, their size wouldn't be taken into account for the `required_staging_buffer_size`. In some cases, this meant the buffers wouldn't be resized when they should. Now `prepare_staging_buffers()` is called over all assets, which may hit performance but at least gets the size right. Shortly after `prepare_staging_buffers()`, `set_required_staging_buffer_size_to_max()` would unconditionally overwrite the previously computed value, even if using `item_size` made no sense. Now it only overwrites the value if bigger. This can be considered a short term hack, but should prevent a few hard to debug panics. |
||
---|---|---|
.. | ||
bevy_app | ||
bevy_asset | ||
bevy_audio | ||
bevy_core | ||
bevy_derive | ||
bevy_diagnostic | ||
bevy_dylib | ||
bevy_dynamic_plugin | ||
bevy_ecs | ||
bevy_gilrs | ||
bevy_gltf | ||
bevy_input | ||
bevy_internal | ||
bevy_log | ||
bevy_math | ||
bevy_pbr | ||
bevy_reflect | ||
bevy_render | ||
bevy_scene | ||
bevy_sprite | ||
bevy_tasks | ||
bevy_text | ||
bevy_transform | ||
bevy_ui | ||
bevy_utils | ||
bevy_wgpu | ||
bevy_window | ||
bevy_winit |