bevy/crates/bevy_ui/src/render
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
..
mod.rs UI batching Fix (#9610) 2023-11-03 01:14:43 +00:00
pipeline.rs Bevy Asset V2 (#8624) 2023-09-07 02:07:27 +00:00
render_pass.rs Fix UI borders (#10078) 2023-10-13 17:17:16 +00:00
ui.wgsl update shader imports (#10180) 2023-10-21 11:51:58 +00:00