bevy/crates/bevy_ui/src
ickshonpe d70b4a3170
UI batching Fix (#9610)
# Objective

Reimplement #8793 on top of the recent rendering changes.

## Solution

The batch creation logic is quite convoluted, but I tested it on enough
examples to convince myself that it works.

The initial value of `batch_image_handle` is changed from
`HandleId::Id(Uuid::nil(), u64::MAX)` to `DEFAULT_IMAGE_HANDLE.id()`,
which allowed me to make the if-block simpler I think.

The default image from `DEFAULT_IMAGE_HANDLE` is always inserted into
`UiImageBindGroups` even if it's not used. I tried to add a check so
that it would be only inserted when there is only one batch using the
default image but this crashed.

---

## Changelog
`prepare_uinodes`
* Changed the initial value of `batch_image_handle` to
`DEFAULT_IMAGE_HANDLE.id()`.
* The default image is added to the UI image bind groups before
assembling the batches.
* A new `UiBatch` isn't created when the next `ExtractedUiNode`s image
is set to `DEFAULT_IMAGE_HANDLE` (unless it is the first item in the UI
phase items list).
2023-11-03 01:14:43 +00:00
..
layout Update UI alignment docs (#10303) 2023-10-29 15:32:11 +00:00
render UI batching Fix (#9610) 2023-11-03 01:14:43 +00:00
widget Fix crash with certain right-aligned text (#10271) 2023-10-26 22:09:34 +00:00
accessibility.rs Various accessibility API updates. (#9989) 2023-10-02 21:22:52 +00:00
camera_config.rs bevy_reflect: FromReflect Ergonomics Implementation (#6056) 2023-06-29 01:31:34 +00:00
focus.rs Fix the clippy::explicit_iter_loop lint (#9834) 2023-09-19 03:35:22 +00:00
geometry.rs don't Implement Display for Val (#10345) 2023-11-02 21:54:41 +00:00
lib.rs UI node outlines (#9931) 2023-10-05 12:10:32 +00:00
measurement.rs Change the default for the measure_func field of ContentSize to None. (#9346) 2023-08-07 23:06:40 +00:00
node_bundles.rs Add link to Text2dBundle in TextBundle docs. (#9900) 2023-09-25 20:33:42 +00:00
stack.rs Add stack index to Node (#9853) 2023-10-31 23:32:51 +00:00
ui_node.rs Add stack index to Node (#9853) 2023-10-31 23:32:51 +00:00
update.rs Do not panic on non-UI child of UI entity (#9621) 2023-08-29 10:49:40 +00:00