bevy/crates/bevy_core_pipeline/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
..
bloom Add try_* to add_slot_edge, add_node_edge (#6720) 2022-11-21 21:58:39 +00:00
core_2d Flatten render commands (#6885) 2023-01-04 01:13:30 +00:00
core_3d Flatten render commands (#6885) 2023-01-04 01:13:30 +00:00
fullscreen_vertex_shader separate tonemapping and upscaling passes (#3425) 2022-10-26 20:13:59 +00:00
fxaa Shader defs can now have a value (#5900) 2022-11-21 22:38:29 +00:00
tonemapping Fix missing sRGB conversion for dithering non-HDR pipelines (#6707) 2022-11-22 15:55:50 +00:00
upscaling Make Core Pipeline Graph Nodes Public (#6605) 2022-11-18 22:16:55 +00:00
clear_color.rs Make Resource trait opt-in, requiring #[derive(Resource)] V2 (#5577) 2022-08-08 21:36:35 +00:00
lib.rs Bloom (#6397) 2022-11-04 01:34:12 +00:00