bevy/crates/bevy_ui/src
James Liu 2d727afaf7 Flatten render commands (#6885)
# Objective
Speed up the render phase of rendering. Simplify the trait structure for render commands.

## Solution

 - Merge `EntityPhaseItem` into `PhaseItem` (`EntityPhaseItem::entity` -> `PhaseItem::entity`)
 - Merge `EntityRenderCommand` into `RenderCommand`.
 - Add two associated types to `RenderCommand`: `RenderCommand::ViewWorldQuery` and `RenderCommand::WorldQuery`.
 - Use the new associated types to construct two `QueryStates`s for `RenderCommandState`.
 - Hoist any `SQuery<T>` fetches in `EntityRenderCommand`s into the aformentioned two queries. Batch fetch them all at once.

## Performance
`main_opaque_pass_3d` is slightly faster on `many_foxes` (427.52us -> 401.15us)

![image](https://user-images.githubusercontent.com/3137680/206359804-9928b20a-7d92-41f8-bf7d-6e8c5cc802f0.png)

The shadow pass node is also slightly faster (344.52 -> 338.24us)

![image](https://user-images.githubusercontent.com/3137680/206359977-1212198d-f933-49a0-80f1-62ff88eb5727.png)

## Future Work

 - Can we hoist the view level queries out of the core loop?

---

## Changelog
Added: `PhaseItem::entity`
Added: `RenderCommand::ViewWorldQuery` associated type.
Added: `RenderCommand::ItemorldQuery` associated type.
Added: `Draw<T>::prepare` optional trait function.
Removed: `EntityPhaseItem` trait

## Migration Guide
TODO
2023-01-04 01:13:30 +00:00
..
flex Upgrade to Taffy 0.2 (#6743) 2022-12-21 02:15:53 +00:00
render Flatten render commands (#6885) 2023-01-04 01:13:30 +00:00
widget text aspect ratio bug fix (#6825) 2022-12-20 16:44:12 +00:00
camera_config.rs Fix UiCameraConfig doc (link to the Camera page) (#6969) 2022-12-20 23:32:04 +00:00
focus.rs Add set_if_neq method to DetectChanges trait (Rebased) (#6853) 2022-12-11 19:24:19 +00:00
geometry.rs Make function Size::new const for bevy_ui widgets (#6602) 2022-11-14 23:08:29 +00:00
lib.rs Remove ImageMode (#6674) 2022-11-18 21:16:32 +00:00
node_bundles.rs Remove needless manual default impl of ButtonBundle (#6970) 2022-12-20 16:17:14 +00:00
stack.rs Add z-index support with a predictable UI stack (#5877) 2022-11-02 22:06:04 +00:00
ui_node.rs Upgrade to Taffy 0.2 (#6743) 2022-12-21 02:15:53 +00:00
update.rs Add z-index support with a predictable UI stack (#5877) 2022-11-02 22:06:04 +00:00