bevy/crates
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
..
bevy_animation Release 0.9.0 (#6568) 2022-11-12 20:01:29 +00:00
bevy_app #4231: panic when App::run() is called from Plugin::build() (#4241) 2022-12-24 23:43:41 +00:00
bevy_asset Derive clone and debug for AssetPlugin (#6583) 2022-11-14 23:08:26 +00:00
bevy_audio document file formats for bytes field of AudioSource (#6619) 2022-12-11 18:10:02 +00:00
bevy_core Fix reflection for PathBuf and OsString (#6776) 2022-11-27 17:28:06 +00:00
bevy_core_pipeline Flatten render commands (#6885) 2023-01-04 01:13:30 +00:00
bevy_derive Fix ndk-macro link (#7027) 2022-12-25 05:06:03 +00:00
bevy_diagnostic add system information plugin and update relevant examples (#5911) 2023-01-02 20:49:43 +00:00
bevy_dylib Release 0.9.0 (#6568) 2022-11-12 20:01:29 +00:00
bevy_dynamic_plugin Adapt path type of dynamically_load_plugin (#6734) 2022-12-05 23:39:43 +00:00
bevy_ecs Extend EntityLocation with TableId and TableRow (#6681) 2023-01-02 21:25:04 +00:00
bevy_ecs_compile_fail_tests Fix clippy lints and failed test with Rust 1.66 (#6945) 2022-12-15 18:05:15 +00:00
bevy_encase_derive Release 0.9.0 (#6568) 2022-11-12 20:01:29 +00:00
bevy_gilrs Bump gilrs version to 0.10 (#6558) 2022-11-15 20:31:17 +00:00
bevy_gltf enum Visibility component (#6320) 2022-12-25 00:39:29 +00:00
bevy_hierarchy don't error when sending HierarchyEvents when Event type not registered (#7031) 2022-12-26 16:39:17 +00:00
bevy_input Avoid triggering change detection for inputs (#6847) 2022-12-11 18:22:09 +00:00
bevy_internal Replace WgpuAdapterInfo with RenderAdapterInfo in the documentation. (#7036) 2022-12-26 19:47:01 +00:00
bevy_log Fix suppression of all console logs when trace_tracy is enabled (#6955) 2022-12-20 23:45:43 +00:00
bevy_macro_utils Release 0.9.0 (#6568) 2022-11-12 20:01:29 +00:00
bevy_math Improve code/comments for Ray::intersect_plane and its tests (#6823) 2022-12-05 22:49:06 +00:00
bevy_mikktspace Release 0.9.0 (#6568) 2022-11-12 20:01:29 +00:00
bevy_pbr Flatten render commands (#6885) 2023-01-04 01:13:30 +00:00
bevy_ptr Round out the untyped api s (#7009) 2022-12-27 16:05:16 +00:00
bevy_reflect Add reflection support for VecDeque (#6831) 2022-12-11 18:22:08 +00:00
bevy_reflect_compile_fail_tests bevy_reflect: Add compile fail tests for bevy_reflect (#7041) 2023-01-02 21:07:33 +00:00
bevy_render Flatten render commands (#6885) 2023-01-04 01:13:30 +00:00
bevy_scene Cleanup dynamic scene before building (#6254) 2022-12-20 16:16:58 +00:00
bevy_sprite Flatten render commands (#6885) 2023-01-04 01:13:30 +00:00
bevy_tasks Add thread create/destroy callbacks to TaskPool (#6561) 2022-12-20 16:17:02 +00:00
bevy_text Remove TextError::ExceedMaxTextAtlases(usize) variant (#6796) 2022-12-05 23:23:16 +00:00
bevy_time Update old docs from Timer (#6646) 2022-11-18 20:42:33 +00:00
bevy_transform Add a reparented_to method to GlobalTransform (#7020) 2022-12-25 00:51:20 +00:00
bevy_ui Flatten render commands (#6885) 2023-01-04 01:13:30 +00:00
bevy_utils Document remaining members of bevy_utils (#6897) 2022-12-11 18:46:42 +00:00
bevy_window Derive Reflect + FromReflect for window event types (#6235) 2022-12-09 01:20:44 +00:00
bevy_winit Apply WindowDescriptor settings in all modes (#6934) 2022-12-16 20:14:11 +00:00