bevy/crates/bevy_render/src/render_graph
Renato Caldas 87399c3560 Fix staging buffer required size calculation (fixes #1056) (#1509)
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.
2021-03-06 01:42:57 +00:00
..
nodes Fix staging buffer required size calculation (fixes #1056) (#1509) 2021-03-06 01:42:57 +00:00
base.rs Bevy ECS V2 (#1525) 2021-03-05 07:54:35 +00:00
command.rs Bevy ECS V2 (#1525) 2021-03-05 07:54:35 +00:00
edge.rs move bevy crates to their own folder 2020-04-24 17:57:20 -07:00
graph.rs Bevy ECS V2 (#1525) 2021-03-05 07:54:35 +00:00
mod.rs Fix errors and panics to typical Rust conventions (#968) 2020-12-02 11:31:16 -08:00
node.rs Bevy ECS V2 (#1525) 2021-03-05 07:54:35 +00:00
node_slot.rs github actions: use stable clippy (#577) 2020-09-25 21:34:47 -07:00
schedule.rs Bevy ECS V2 (#1525) 2021-03-05 07:54:35 +00:00
system.rs Bevy ECS V2 (#1525) 2021-03-05 07:54:35 +00:00