bevy/crates
James Liu bef9bc1844 Reduce branching in TrackedRenderPass (#7053)
# Objective
Speed up the render phase for rendering.

## Solution
 - Follow up #6988 and make the internals of atomic IDs `NonZeroU32`. This niches the `Option`s of the IDs in draw state, which reduces the size and branching behavior when evaluating for equality.
 - Require `&RenderDevice` to get the device's `Limits` when initializing a `TrackedRenderPass` to preallocate the bind groups and vertex buffer state in `DrawState`, this removes the branch on needing to resize those `Vec`s.

## Performance
This produces a similar speed up akin to that of #6885. This shows an approximate 6% speed up in `main_opaque_pass_3d` on `many_foxes` (408.79 us -> 388us). This should be orthogonal to the gains seen there.

![image](https://user-images.githubusercontent.com/3137680/209906239-e430f026-63c2-4b95-957e-a2045b810d79.png)

---

## Changelog
Added: `RenderContext::begin_tracked_render_pass`.
Changed: `TrackedRenderPass` now requires a `&RenderDevice` on construction.
Removed: `bevy_render::render_phase::DrawState`. It was not usable in any form outside of `bevy_render`.

## Migration Guide
TODO
2023-01-09 19:24:56 +00:00
..
bevy_animation Smooth Transition between Animations (#6922) 2023-01-09 19:24:51 +00:00
bevy_app Separate Extract from Sub App Schedule (#7046) 2023-01-09 19:24:54 +00:00
bevy_asset Fix various typos (#7096) 2023-01-06 00:43:30 +00:00
bevy_audio Expose symphonia features from rodio in bevy_audio and bevy (#6388) 2023-01-09 19:05:30 +00:00
bevy_core Break CorePlugin into TaskPoolPlugin, TypeRegistrationPlugin, FrameCountPlugin. (#7083) 2023-01-05 11:42:35 +00:00
bevy_core_pipeline Reduce branching in TrackedRenderPass (#7053) 2023-01-09 19:24:56 +00:00
bevy_derive Fix ndk-macro link (#7027) 2022-12-25 05:06:03 +00:00
bevy_diagnostic Fix various typos (#7096) 2023-01-06 00:43:30 +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 Separate Extract from Sub App Schedule (#7046) 2023-01-09 19:24:54 +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 Gamepad events refactor (#6965) 2023-01-09 19:24:52 +00:00
bevy_gltf enum Visibility component (#6320) 2022-12-25 00:39:29 +00:00
bevy_hierarchy Fix various typos (#7096) 2023-01-06 00:43:30 +00:00
bevy_input Gamepad events refactor (#6965) 2023-01-09 19:24:52 +00:00
bevy_internal Expose symphonia features from rodio in bevy_audio and bevy (#6388) 2023-01-09 19:05:30 +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 Reduce branching in TrackedRenderPass (#7053) 2023-01-09 19:24:56 +00:00
bevy_ptr Round out the untyped api s (#7009) 2022-12-27 16:05:16 +00:00
bevy_reflect bevy_reflect: Fix deserialization with readers (#6894) 2023-01-04 22:03:31 +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 Reduce branching in TrackedRenderPass (#7053) 2023-01-09 19:24:56 +00:00
bevy_scene Fix various typos (#7096) 2023-01-06 00:43:30 +00:00
bevy_sprite Fix various typos (#7096) 2023-01-06 00:43:30 +00:00
bevy_tasks Fix various typos (#7096) 2023-01-06 00:43:30 +00:00
bevy_text Remove TextError::ExceedMaxTextAtlases(usize) variant (#6796) 2022-12-05 23:23:16 +00:00
bevy_time Fix various typos (#7096) 2023-01-06 00:43:30 +00:00
bevy_transform Add a reparented_to method to GlobalTransform (#7020) 2022-12-25 00:51:20 +00:00
bevy_ui Reduce branching in TrackedRenderPass (#7053) 2023-01-09 19:24:56 +00:00
bevy_utils Fix various typos (#7096) 2023-01-06 00:43:30 +00:00
bevy_window Fix various typos (#7096) 2023-01-06 00:43:30 +00:00
bevy_winit fix cursor grab issue (#7010) 2023-01-04 23:00:12 +00:00