bevy/crates
Chris Sixsmith a78c4d78d5
Make setup of Opaque3dPrepass and AlphaMask3dPrepass phase items consistent with others (#8408)
# Objective

When browsing the bevy source code to try and learn about
`bevy_core_pipeline`, I noticed that the `DrawFunctions` resources,
`sort_phase_system`s and texture preparation for the `Opaque3d` and
`AlphaMask3d` phase items are all set up in `bevy_core_pipeline`, while
the `Opaque3dPrepass` and `AlphaMask3dPrepass` phase items are only
*declared* in `bevy_core_pipeline`, and actually registered properly
with the renderer in `bevy_pbr`.

This means that, if I am trying to make crate that replaces `bevy_pbr`,
I need to make sure I manually fix this unfinished setup the same way
that `bevy_pbr` does. Worse, it means that if I try to use the
`PrepassNode` `bevy_core_pipeline` adds *without* fixing this, the
engine will simply crash because the `DrawFunctions<T>` resources cannot
be accessed.

The only advantage I can think of for bevy doing it this way is an
ambiguous performance save due to the prepass render phases not being
present unless you are using prepass materials with PBR.

## Solution

I have moved the registration of `DrawFunctions<T>`,
`sort_phase_system::<T>`, camera `RenderPhase` extraction, and texture
preparation for prepass's phase items into `bevy_core_pipeline`
alongside the equivalent code that sets up the `Opaque3d`, `AlphaMask3d`
and `Transparent3d` phase items.

Am open to tweaking this to improve the performance impact of prepass
things being around if the app doesn't use them if needed.

I've tested that the `shader_prepass` example still works with this
change.
2023-06-12 19:15:28 +00:00
..
bevy_a11y Require #[derive(Event)] on all Events (#7086) 2023-06-06 14:44:32 +00:00
bevy_animation Fixed several missing links in docs. (#8117) 2023-04-23 17:28:36 +00:00
bevy_app Require #[derive(Event)] on all Events (#7086) 2023-06-06 14:44:32 +00:00
bevy_asset Update notify requirement from 5.0.0 to 6.0.0 (#8757) 2023-06-06 21:05:21 +00:00
bevy_audio reflect: stable type path v2 (#7184) 2023-06-05 20:31:20 +00:00
bevy_core Add Reflect and FromReflect for AssetPath (#8531) 2023-05-08 19:19:19 +00:00
bevy_core_pipeline Make setup of Opaque3dPrepass and AlphaMask3dPrepass phase items consistent with others (#8408) 2023-06-12 19:15:28 +00:00
bevy_derive bevy_derive: Add #[deref] attribute (#8552) 2023-05-16 18:29:09 +00:00
bevy_diagnostic Allow systems using Diagnostics to run in parallel (#8677) 2023-06-05 20:51:22 +00:00
bevy_dylib Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_dynamic_plugin Remove stray boilerplate line in bevy_dynamic_plugin/Cargo.toml (#8830) 2023-06-12 19:10:48 +00:00
bevy_ecs Add last_changed_tick and added_tick to ComponentTicks (#8803) 2023-06-12 17:55:09 +00:00
bevy_ecs_compile_fail_tests Resolve clippy issues for rust 1.70.0 (#8738) 2023-06-01 21:05:05 +00:00
bevy_encase_derive update syn, encase, glam and hexasphere (#8573) 2023-05-16 01:24:17 +00:00
bevy_gilrs Add gamepad rumble support to bevy_input (#8398) 2023-04-24 15:28:53 +00:00
bevy_gizmos Webgpu support (#8336) 2023-05-04 22:07:57 +00:00
bevy_gltf reflect: stable type path v2 (#7184) 2023-06-05 20:31:20 +00:00
bevy_hierarchy Rename Command's "write" method to "apply" (#8814) 2023-06-12 17:53:47 +00:00
bevy_input Touchpad magnify and rotate events (#8791) 2023-06-08 20:31:43 +00:00
bevy_internal Add support for pnm textures (#8601) 2023-05-16 23:51:47 +00:00
bevy_log Update android_log-sys requirement from 0.2.0 to 0.3.0 (#7925) 2023-06-01 07:55:33 +00:00
bevy_macro_utils update syn, encase, glam and hexasphere (#8573) 2023-05-16 01:24:17 +00:00
bevy_macros_compile_fail_tests bevy_derive: Add #[deref] attribute (#8552) 2023-05-16 18:29:09 +00:00
bevy_math Add integer equivalents for Rect (#7984) 2023-06-12 19:10:48 +00:00
bevy_mikktspace update syn, encase, glam and hexasphere (#8573) 2023-05-16 01:24:17 +00:00
bevy_pbr Make setup of Opaque3dPrepass and AlphaMask3dPrepass phase items consistent with others (#8408) 2023-06-12 19:15:28 +00:00
bevy_ptr Fixed several missing links in docs. (#8117) 2023-04-23 17:28:36 +00:00
bevy_reflect bevy_reflect: implement Reflect for SmolStr (#8771) 2023-06-08 20:33:21 +00:00
bevy_reflect_compile_fail_tests reflect: stable type path v2 (#7184) 2023-06-05 20:31:20 +00:00
bevy_render Disable camera on window close (#8802) 2023-06-10 19:50:37 +00:00
bevy_scene Rename Command's "write" method to "apply" (#8814) 2023-06-12 17:53:47 +00:00
bevy_sprite reflect: stable type path v2 (#7184) 2023-06-05 20:31:20 +00:00
bevy_tasks remove some use of once_cell that can be replace with new std (#8739) 2023-06-01 21:55:18 +00:00
bevy_text reflect: stable type path v2 (#7184) 2023-06-05 20:31:20 +00:00
bevy_time Hide naga info logs & Derive PartialEq on Timer and Stopwatch (#8664) 2023-05-24 15:16:15 +00:00
bevy_transform Rename Command's "write" method to "apply" (#8814) 2023-06-12 17:53:47 +00:00
bevy_ui Register a few missed reflect components (#8807) 2023-06-10 23:19:39 +00:00
bevy_utils Fix all_tuples + added docs. (#8743) 2023-06-02 16:05:27 +00:00
bevy_window Register a few missed reflect components (#8807) 2023-06-10 23:19:39 +00:00
bevy_winit Touchpad magnify and rotate events (#8791) 2023-06-08 20:31:43 +00:00