From 359ff7eb6c2cb7ed29c1947abb713ab1c019d86a Mon Sep 17 00:00:00 2001 From: Carter Anderson Date: Tue, 5 Aug 2025 18:14:04 -0700 Subject: [PATCH 1/3] Remove manual type registrations --- crates/bevy_animation/src/lib.rs | 9 +--- .../src/contrast_adaptive_sharpening/mod.rs | 1 - crates/bevy_anti_aliasing/src/fxaa/mod.rs | 1 - crates/bevy_anti_aliasing/src/smaa/mod.rs | 3 +- crates/bevy_anti_aliasing/src/taa/mod.rs | 2 - crates/bevy_app/src/app.rs | 7 --- crates/bevy_asset/src/lib.rs | 3 +- crates/bevy_audio/src/lib.rs | 8 +-- crates/bevy_camera/src/lib.rs | 20 ++------ crates/bevy_camera/src/projection.rs | 16 +++--- crates/bevy_camera/src/visibility/mod.rs | 12 +---- crates/bevy_camera/src/visibility/range.rs | 14 +++--- .../src/auto_exposure/mod.rs | 2 - crates/bevy_core_pipeline/src/bloom/mod.rs | 3 -- crates/bevy_core_pipeline/src/core_2d/mod.rs | 3 +- crates/bevy_core_pipeline/src/core_3d/mod.rs | 4 +- crates/bevy_core_pipeline/src/dof/mod.rs | 2 - crates/bevy_core_pipeline/src/lib.rs | 25 +++------- crates/bevy_core_pipeline/src/oit/mod.rs | 3 +- .../src/post_process/mod.rs | 1 - crates/bevy_core_pipeline/src/skybox/mod.rs | 2 +- .../bevy_core_pipeline/src/tonemapping/mod.rs | 3 -- crates/bevy_gizmos/src/aabb.rs | 24 +++++---- crates/bevy_gizmos/src/lib.rs | 4 +- crates/bevy_gizmos/src/light.rs | 22 ++++----- crates/bevy_gltf/src/lib.rs | 8 +-- crates/bevy_image/src/texture_atlas.rs | 3 +- crates/bevy_input/src/lib.rs | 32 ------------ .../src/directional_navigation.rs | 4 -- crates/bevy_input_focus/src/lib.rs | 5 -- crates/bevy_input_focus/src/tab_navigation.rs | 3 -- crates/bevy_light/src/lib.rs | 23 ++------- crates/bevy_pbr/src/atmosphere/mod.rs | 14 +++--- crates/bevy_pbr/src/decal/clustered.rs | 3 +- crates/bevy_pbr/src/decal/forward.rs | 2 - crates/bevy_pbr/src/lib.rs | 1 - crates/bevy_pbr/src/render/fog.rs | 1 - crates/bevy_pbr/src/ssao/mod.rs | 2 - crates/bevy_pbr/src/ssr/mod.rs | 3 +- crates/bevy_pbr/src/wireframe.rs | 3 -- crates/bevy_picking/src/input.rs | 1 - crates/bevy_picking/src/lib.rs | 11 +---- crates/bevy_picking/src/mesh_picking/mod.rs | 4 +- crates/bevy_render/src/camera.rs | 5 +- crates/bevy_render/src/globals.rs | 2 - crates/bevy_render/src/lib.rs | 49 +++++++------------ crates/bevy_render/src/mesh/mod.rs | 37 +------------- crates/bevy_render/src/storage.rs | 1 - crates/bevy_render/src/texture/mod.rs | 1 - crates/bevy_render/src/view/mod.rs | 4 +- .../bevy_render/src/view/window/screenshot.rs | 4 +- crates/bevy_scene/src/lib.rs | 2 - crates/bevy_scene/src/scene_spawner.rs | 3 +- crates/bevy_solari/src/pathtracer/mod.rs | 2 - crates/bevy_solari/src/realtime/mod.rs | 3 +- crates/bevy_solari/src/scene/mod.rs | 2 - crates/bevy_sprite/src/lib.rs | 37 ++++++-------- crates/bevy_sprite/src/mesh2d/wireframe2d.rs | 3 -- crates/bevy_sprite/src/picking_backend.rs | 3 -- crates/bevy_sprite/src/tilemap_chunk/mod.rs | 5 +- crates/bevy_text/src/lib.rs | 10 ---- crates/bevy_time/src/lib.rs | 3 +- crates/bevy_transform/src/plugins.rs | 5 -- crates/bevy_ui/src/lib.rs | 42 +--------------- crates/bevy_ui/src/picking_backend.rs | 1 - crates/bevy_ui_render/src/lib.rs | 2 - crates/bevy_window/src/lib.rs | 28 ----------- examples/no_std/library/src/lib.rs | 3 +- examples/reflection/reflection.rs | 2 - examples/remote/server.rs | 3 -- examples/scene/scene.rs | 3 -- 71 files changed, 114 insertions(+), 468 deletions(-) diff --git a/crates/bevy_animation/src/lib.rs b/crates/bevy_animation/src/lib.rs index 0c667417b5ae3..67e5cde0466a9 100644 --- a/crates/bevy_animation/src/lib.rs +++ b/crates/bevy_animation/src/lib.rs @@ -40,7 +40,6 @@ use bevy_reflect::{prelude::ReflectDefault, Reflect, TypePath}; use bevy_time::Time; use bevy_transform::TransformSystems; use bevy_utils::{PreHashMap, PreHashMapExt, TypeIdMap}; -use petgraph::graph::NodeIndex; use serde::{Deserialize, Serialize}; use thread_local::ThreadLocal; use tracing::{trace, warn}; @@ -60,7 +59,7 @@ pub mod prelude { use crate::{ animation_curves::AnimationCurve, graph::{AnimationGraph, AnimationGraphAssetLoader, AnimationNodeIndex}, - transition::{advance_transitions, expire_completed_transitions, AnimationTransitions}, + transition::{advance_transitions, expire_completed_transitions}, }; use alloc::sync::Arc; @@ -1234,12 +1233,6 @@ impl Plugin for AnimationPlugin { .init_asset_loader::() .register_asset_reflect::() .register_asset_reflect::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() .init_resource::() .add_systems( PostUpdate, diff --git a/crates/bevy_anti_aliasing/src/contrast_adaptive_sharpening/mod.rs b/crates/bevy_anti_aliasing/src/contrast_adaptive_sharpening/mod.rs index 872175dbc741b..845f4c98dd462 100644 --- a/crates/bevy_anti_aliasing/src/contrast_adaptive_sharpening/mod.rs +++ b/crates/bevy_anti_aliasing/src/contrast_adaptive_sharpening/mod.rs @@ -103,7 +103,6 @@ impl Plugin for CasPlugin { fn build(&self, app: &mut App) { embedded_asset!(app, "robust_contrast_adaptive_sharpening.wgsl"); - app.register_type::(); app.add_plugins(( ExtractComponentPlugin::::default(), UniformComponentPlugin::::default(), diff --git a/crates/bevy_anti_aliasing/src/fxaa/mod.rs b/crates/bevy_anti_aliasing/src/fxaa/mod.rs index bba559626379b..6b67770230684 100644 --- a/crates/bevy_anti_aliasing/src/fxaa/mod.rs +++ b/crates/bevy_anti_aliasing/src/fxaa/mod.rs @@ -86,7 +86,6 @@ impl Plugin for FxaaPlugin { fn build(&self, app: &mut App) { embedded_asset!(app, "fxaa.wgsl"); - app.register_type::(); app.add_plugins(ExtractComponentPlugin::::default()); let Some(render_app) = app.get_sub_app_mut(RenderApp) else { diff --git a/crates/bevy_anti_aliasing/src/smaa/mod.rs b/crates/bevy_anti_aliasing/src/smaa/mod.rs index d54dff8e9ce5d..3d3913ccce4ca 100644 --- a/crates/bevy_anti_aliasing/src/smaa/mod.rs +++ b/crates/bevy_anti_aliasing/src/smaa/mod.rs @@ -313,8 +313,7 @@ impl Plugin for SmaaPlugin { } }; - app.add_plugins(ExtractComponentPlugin::::default()) - .register_type::(); + app.add_plugins(ExtractComponentPlugin::::default()); let Some(render_app) = app.get_sub_app_mut(RenderApp) else { return; diff --git a/crates/bevy_anti_aliasing/src/taa/mod.rs b/crates/bevy_anti_aliasing/src/taa/mod.rs index 263ebd00436ff..3055160a820c9 100644 --- a/crates/bevy_anti_aliasing/src/taa/mod.rs +++ b/crates/bevy_anti_aliasing/src/taa/mod.rs @@ -51,8 +51,6 @@ impl Plugin for TemporalAntiAliasPlugin { fn build(&self, app: &mut App) { embedded_asset!(app, "taa.wgsl"); - app.register_type::(); - app.add_plugins(SyncComponentPlugin::::default()); let Some(render_app) = app.get_sub_app_mut(RenderApp) else { diff --git a/crates/bevy_app/src/app.rs b/crates/bevy_app/src/app.rs index 9ff4792960679..c6c16cb5bed86 100644 --- a/crates/bevy_app/src/app.rs +++ b/crates/bevy_app/src/app.rs @@ -106,18 +106,11 @@ impl Default for App { #[cfg(feature = "bevy_reflect")] { - use bevy_ecs::observer::ObservedBy; - #[cfg(not(feature = "reflect_auto_register"))] app.init_resource::(); #[cfg(feature = "reflect_auto_register")] app.insert_resource(AppTypeRegistry::new_with_derived_types()); - - app.register_type::(); - app.register_type::(); - app.register_type::(); - app.register_type::(); } #[cfg(feature = "reflect_functions")] diff --git a/crates/bevy_asset/src/lib.rs b/crates/bevy_asset/src/lib.rs index 8186b6315d5b4..3c939b07cf8b0 100644 --- a/crates/bevy_asset/src/lib.rs +++ b/crates/bevy_asset/src/lib.rs @@ -422,8 +422,7 @@ impl Plugin for AssetPlugin { // and as a result has ambiguous system ordering with all other systems in `PreUpdate`. // This is virtually never a real problem: asset loading is async and so anything that interacts directly with it // needs to be robust to stochastic delays anyways. - .add_systems(PreUpdate, handle_internal_asset_events.ambiguous_with_all()) - .register_type::(); + .add_systems(PreUpdate, handle_internal_asset_events.ambiguous_with_all()); } } diff --git a/crates/bevy_audio/src/lib.rs b/crates/bevy_audio/src/lib.rs index e3b5e02569fd2..43e7cbe05c0e0 100644 --- a/crates/bevy_audio/src/lib.rs +++ b/crates/bevy_audio/src/lib.rs @@ -80,13 +80,7 @@ pub struct AudioPlugin { impl Plugin for AudioPlugin { fn build(&self, app: &mut App) { - app.register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .insert_resource(self.global_volume) + app.insert_resource(self.global_volume) .insert_resource(DefaultSpatialScale(self.default_spatial_scale)) .configure_sets( PostUpdate, diff --git a/crates/bevy_camera/src/lib.rs b/crates/bevy_camera/src/lib.rs index bf0ededae8314..1ae5c8107860e 100644 --- a/crates/bevy_camera/src/lib.rs +++ b/crates/bevy_camera/src/lib.rs @@ -18,20 +18,10 @@ pub struct CameraPlugin; impl Plugin for CameraPlugin { fn build(&self, app: &mut App) { - app.register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .init_resource::() - .add_plugins(( - CameraProjectionPlugin, - visibility::VisibilityPlugin, - visibility::VisibilityRangePlugin, - )); + app.init_resource::().add_plugins(( + CameraProjectionPlugin, + visibility::VisibilityPlugin, + visibility::VisibilityRangePlugin, + )); } } diff --git a/crates/bevy_camera/src/projection.rs b/crates/bevy_camera/src/projection.rs index 847714208d12a..1d2bfdab27561 100644 --- a/crates/bevy_camera/src/projection.rs +++ b/crates/bevy_camera/src/projection.rs @@ -18,16 +18,12 @@ pub struct CameraProjectionPlugin; impl Plugin for CameraProjectionPlugin { fn build(&self, app: &mut App) { - app.register_type::() - .register_type::() - .register_type::() - .register_type::() - .add_systems( - PostUpdate, - crate::visibility::update_frusta - .in_set(VisibilitySystems::UpdateFrusta) - .after(TransformSystems::Propagate), - ); + app.add_systems( + PostUpdate, + crate::visibility::update_frusta + .in_set(VisibilitySystems::UpdateFrusta) + .after(TransformSystems::Propagate), + ); } } diff --git a/crates/bevy_camera/src/visibility/mod.rs b/crates/bevy_camera/src/visibility/mod.rs index 478db336e32a3..275715cb26b33 100644 --- a/crates/bevy_camera/src/visibility/mod.rs +++ b/crates/bevy_camera/src/visibility/mod.rs @@ -340,17 +340,7 @@ impl Plugin for VisibilityPlugin { fn build(&self, app: &mut bevy_app::App) { use VisibilitySystems::*; - app.register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_required_components::() + app.register_required_components::() .register_required_components::() .register_required_components::() .register_required_components::() diff --git a/crates/bevy_camera/src/visibility/range.rs b/crates/bevy_camera/src/visibility/range.rs index b85631c9d5c75..b827dedbbf10c 100644 --- a/crates/bevy_camera/src/visibility/range.rs +++ b/crates/bevy_camera/src/visibility/range.rs @@ -30,14 +30,12 @@ pub struct VisibilityRangePlugin; impl Plugin for VisibilityRangePlugin { fn build(&self, app: &mut App) { - app.register_type::() - .init_resource::() - .add_systems( - PostUpdate, - check_visibility_ranges - .in_set(VisibilitySystems::CheckVisibility) - .before(check_visibility), - ); + app.init_resource::().add_systems( + PostUpdate, + check_visibility_ranges + .in_set(VisibilitySystems::CheckVisibility) + .before(check_visibility), + ); } } diff --git a/crates/bevy_core_pipeline/src/auto_exposure/mod.rs b/crates/bevy_core_pipeline/src/auto_exposure/mod.rs index 805e67ec97c6e..773ab8b12f646 100644 --- a/crates/bevy_core_pipeline/src/auto_exposure/mod.rs +++ b/crates/bevy_core_pipeline/src/auto_exposure/mod.rs @@ -46,14 +46,12 @@ impl Plugin for AutoExposurePlugin { embedded_asset!(app, "auto_exposure.wgsl"); app.add_plugins(RenderAssetPlugin::::default()) - .register_type::() .init_asset::() .register_asset_reflect::(); app.world_mut() .resource_mut::>() .insert(&Handle::default(), AutoExposureCompensationCurve::default()); - app.register_type::(); app.add_plugins(ExtractComponentPlugin::::default()); let Some(render_app) = app.get_sub_app_mut(RenderApp) else { diff --git a/crates/bevy_core_pipeline/src/bloom/mod.rs b/crates/bevy_core_pipeline/src/bloom/mod.rs index 09112794026ba..f07675fad36c7 100644 --- a/crates/bevy_core_pipeline/src/bloom/mod.rs +++ b/crates/bevy_core_pipeline/src/bloom/mod.rs @@ -49,9 +49,6 @@ impl Plugin for BloomPlugin { fn build(&self, app: &mut App) { embedded_asset!(app, "bloom.wgsl"); - app.register_type::(); - app.register_type::(); - app.register_type::(); app.add_plugins(( ExtractComponentPlugin::::default(), UniformComponentPlugin::::default(), diff --git a/crates/bevy_core_pipeline/src/core_2d/mod.rs b/crates/bevy_core_pipeline/src/core_2d/mod.rs index f051c1164cc8a..70146efd7a253 100644 --- a/crates/bevy_core_pipeline/src/core_2d/mod.rs +++ b/crates/bevy_core_pipeline/src/core_2d/mod.rs @@ -80,8 +80,7 @@ pub struct Core2dPlugin; impl Plugin for Core2dPlugin { fn build(&self, app: &mut App) { - app.register_type::() - .register_required_components::() + app.register_required_components::() .register_required_components_with::(|| { CameraRenderGraph::new(Core2d) }) diff --git a/crates/bevy_core_pipeline/src/core_3d/mod.rs b/crates/bevy_core_pipeline/src/core_3d/mod.rs index 9fd7880869546..ad058f8579072 100644 --- a/crates/bevy_core_pipeline/src/core_3d/mod.rs +++ b/crates/bevy_core_pipeline/src/core_3d/mod.rs @@ -139,9 +139,7 @@ pub struct Core3dPlugin; impl Plugin for Core3dPlugin { fn build(&self, app: &mut App) { - app.register_type::() - .register_type::() - .register_required_components_with::(|| DebandDither::Enabled) + app.register_required_components_with::(|| DebandDither::Enabled) .register_required_components_with::(|| { CameraRenderGraph::new(Core3d) }) diff --git a/crates/bevy_core_pipeline/src/dof/mod.rs b/crates/bevy_core_pipeline/src/dof/mod.rs index 51ec0b97af61d..10ca30c8fc2c8 100644 --- a/crates/bevy_core_pipeline/src/dof/mod.rs +++ b/crates/bevy_core_pipeline/src/dof/mod.rs @@ -207,8 +207,6 @@ impl Plugin for DepthOfFieldPlugin { fn build(&self, app: &mut App) { embedded_asset!(app, "dof.wgsl"); - app.register_type::(); - app.register_type::(); app.add_plugins(UniformComponentPlugin::::default()); app.add_plugins(SyncComponentPlugin::::default()); diff --git a/crates/bevy_core_pipeline/src/lib.rs b/crates/bevy_core_pipeline/src/lib.rs index bc3159de18712..1b5f022428a3c 100644 --- a/crates/bevy_core_pipeline/src/lib.rs +++ b/crates/bevy_core_pipeline/src/lib.rs @@ -37,19 +37,11 @@ pub mod prelude { } use crate::{ - blit::BlitPlugin, - bloom::BloomPlugin, - core_2d::Core2dPlugin, - core_3d::Core3dPlugin, - deferred::copy_lighting_id::CopyDeferredLightingIdPlugin, - dof::DepthOfFieldPlugin, - experimental::mip_generation::MipGenerationPlugin, - motion_blur::MotionBlurPlugin, - msaa_writeback::MsaaWritebackPlugin, - post_process::PostProcessingPlugin, - prepass::{DeferredPrepass, DepthPrepass, MotionVectorPrepass, NormalPrepass}, - tonemapping::TonemappingPlugin, - upscaling::UpscalingPlugin, + blit::BlitPlugin, bloom::BloomPlugin, core_2d::Core2dPlugin, core_3d::Core3dPlugin, + deferred::copy_lighting_id::CopyDeferredLightingIdPlugin, dof::DepthOfFieldPlugin, + experimental::mip_generation::MipGenerationPlugin, motion_blur::MotionBlurPlugin, + msaa_writeback::MsaaWritebackPlugin, post_process::PostProcessingPlugin, + tonemapping::TonemappingPlugin, upscaling::UpscalingPlugin, }; use bevy_app::{App, Plugin}; use bevy_asset::embedded_asset; @@ -63,12 +55,7 @@ impl Plugin for CorePipelinePlugin { fn build(&self, app: &mut App) { embedded_asset!(app, "fullscreen_vertex_shader/fullscreen.wgsl"); - app.register_type::() - .register_type::() - .register_type::() - .register_type::() - .init_resource::() - .add_plugins((Core2dPlugin, Core3dPlugin, CopyDeferredLightingIdPlugin)) + app.add_plugins((Core2dPlugin, Core3dPlugin, CopyDeferredLightingIdPlugin)) .add_plugins(( BlitPlugin, MsaaWritebackPlugin, diff --git a/crates/bevy_core_pipeline/src/oit/mod.rs b/crates/bevy_core_pipeline/src/oit/mod.rs index 9c20f4739d752..774d18efe55bf 100644 --- a/crates/bevy_core_pipeline/src/oit/mod.rs +++ b/crates/bevy_core_pipeline/src/oit/mod.rs @@ -106,8 +106,7 @@ impl Plugin for OrderIndependentTransparencyPlugin { OitResolvePlugin, )) .add_systems(Update, check_msaa) - .add_systems(Last, configure_depth_texture_usages) - .register_type::(); + .add_systems(Last, configure_depth_texture_usages); let Some(render_app) = app.get_sub_app_mut(RenderApp) else { return; diff --git a/crates/bevy_core_pipeline/src/post_process/mod.rs b/crates/bevy_core_pipeline/src/post_process/mod.rs index 229d4e32c3aa6..551caf28f1f64 100644 --- a/crates/bevy_core_pipeline/src/post_process/mod.rs +++ b/crates/bevy_core_pipeline/src/post_process/mod.rs @@ -201,7 +201,6 @@ impl Plugin for PostProcessingPlugin { RenderAssetUsages::RENDER_WORLD, )); - app.register_type::(); app.add_plugins(ExtractComponentPlugin::::default()); let Some(render_app) = app.get_sub_app_mut(RenderApp) else { diff --git a/crates/bevy_core_pipeline/src/skybox/mod.rs b/crates/bevy_core_pipeline/src/skybox/mod.rs index f80bbbf770c22..205aad66a817e 100644 --- a/crates/bevy_core_pipeline/src/skybox/mod.rs +++ b/crates/bevy_core_pipeline/src/skybox/mod.rs @@ -45,7 +45,7 @@ impl Plugin for SkyboxPlugin { embedded_asset!(app, "skybox.wgsl"); embedded_asset!(app, "skybox_prepass.wgsl"); - app.register_type::().add_plugins(( + app.add_plugins(( ExtractComponentPlugin::::default(), UniformComponentPlugin::::default(), )); diff --git a/crates/bevy_core_pipeline/src/tonemapping/mod.rs b/crates/bevy_core_pipeline/src/tonemapping/mod.rs index 2eb3d267e34c5..90b7de086f318 100644 --- a/crates/bevy_core_pipeline/src/tonemapping/mod.rs +++ b/crates/bevy_core_pipeline/src/tonemapping/mod.rs @@ -82,9 +82,6 @@ impl Plugin for TonemappingPlugin { app.add_plugins(ExtractResourcePlugin::::default()); - app.register_type::(); - app.register_type::(); - app.add_plugins(( ExtractComponentPlugin::::default(), ExtractComponentPlugin::::default(), diff --git a/crates/bevy_gizmos/src/aabb.rs b/crates/bevy_gizmos/src/aabb.rs index 4ac9e5f2ac456..97b4f3e9ebd4c 100644 --- a/crates/bevy_gizmos/src/aabb.rs +++ b/crates/bevy_gizmos/src/aabb.rs @@ -28,19 +28,17 @@ pub struct AabbGizmoPlugin; impl Plugin for AabbGizmoPlugin { fn build(&self, app: &mut bevy_app::App) { - app.register_type::() - .init_gizmo_group::() - .add_systems( - PostUpdate, - ( - draw_aabbs, - draw_all_aabbs.run_if(|config: Res| { - config.config::().1.draw_all - }), - ) - .after(bevy_render::view::VisibilitySystems::CalculateBounds) - .after(TransformSystems::Propagate), - ); + app.init_gizmo_group::().add_systems( + PostUpdate, + ( + draw_aabbs, + draw_all_aabbs.run_if(|config: Res| { + config.config::().1.draw_all + }), + ) + .after(bevy_render::view::VisibilitySystems::CalculateBounds) + .after(TransformSystems::Propagate), + ); } } /// The [`GizmoConfigGroup`] used for debug visualizations of [`Aabb`] components on entities diff --git a/crates/bevy_gizmos/src/lib.rs b/crates/bevy_gizmos/src/lib.rs index 4eeeea508d048..ca3aba088b9a4 100755 --- a/crates/bevy_gizmos/src/lib.rs +++ b/crates/bevy_gizmos/src/lib.rs @@ -159,9 +159,7 @@ impl Plugin for GizmoPlugin { embedded_asset!(app, "line_joints.wgsl"); } - app.register_type::() - .register_type::() - .init_asset::() + app.init_asset::() .init_resource::() // We insert the Resource GizmoConfigStore into the world implicitly here if it does not exist. .init_gizmo_group::(); diff --git a/crates/bevy_gizmos/src/light.rs b/crates/bevy_gizmos/src/light.rs index 1bd6ee3cacb05..4fdd784ac0ec5 100644 --- a/crates/bevy_gizmos/src/light.rs +++ b/crates/bevy_gizmos/src/light.rs @@ -116,18 +116,16 @@ pub struct LightGizmoPlugin; impl Plugin for LightGizmoPlugin { fn build(&self, app: &mut bevy_app::App) { - app.register_type::() - .init_gizmo_group::() - .add_systems( - PostUpdate, - ( - draw_lights, - draw_all_lights.run_if(|config: Res| { - config.config::().1.draw_all - }), - ) - .after(TransformSystems::Propagate), - ); + app.init_gizmo_group::().add_systems( + PostUpdate, + ( + draw_lights, + draw_all_lights.run_if(|config: Res| { + config.config::().1.draw_all + }), + ) + .after(TransformSystems::Propagate), + ); } } diff --git a/crates/bevy_gltf/src/lib.rs b/crates/bevy_gltf/src/lib.rs index 6b90a4d99bcac..c53e1a6b7617e 100644 --- a/crates/bevy_gltf/src/lib.rs +++ b/crates/bevy_gltf/src/lib.rs @@ -208,13 +208,7 @@ impl GltfPlugin { impl Plugin for GltfPlugin { fn build(&self, app: &mut App) { - app.register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .init_asset::() + app.init_asset::() .init_asset::() .init_asset::() .init_asset::() diff --git a/crates/bevy_image/src/texture_atlas.rs b/crates/bevy_image/src/texture_atlas.rs index 67e1b203170a0..b7a7a715a360c 100644 --- a/crates/bevy_image/src/texture_atlas.rs +++ b/crates/bevy_image/src/texture_atlas.rs @@ -19,8 +19,7 @@ impl Plugin for TextureAtlasPlugin { app.init_asset::(); #[cfg(feature = "bevy_reflect")] - app.register_asset_reflect::() - .register_type::(); + app.register_asset_reflect::(); } } diff --git a/crates/bevy_input/src/lib.rs b/crates/bevy_input/src/lib.rs index 77cbe96822d1d..b546452c4e9dd 100644 --- a/crates/bevy_input/src/lib.rs +++ b/crates/bevy_input/src/lib.rs @@ -57,16 +57,12 @@ use mouse::{ }; use touch::{touch_screen_input_system, TouchInput, Touches}; -#[cfg(feature = "bevy_reflect")] -use gamepad::Gamepad; use gamepad::{ gamepad_connection_system, gamepad_event_processing_system, GamepadAxisChangedEvent, GamepadButtonChangedEvent, GamepadButtonStateChangedEvent, GamepadConnectionEvent, GamepadEvent, GamepadRumbleRequest, RawGamepadAxisChangedEvent, RawGamepadButtonChangedEvent, RawGamepadEvent, }; -#[cfg(feature = "bevy_reflect")] -use gamepad::{GamepadAxis, GamepadButton, GamepadConnection, GamepadInput, GamepadSettings}; #[cfg(all(feature = "serialize", feature = "bevy_reflect"))] use bevy_reflect::{ReflectDeserialize, ReflectSerialize}; @@ -134,34 +130,6 @@ impl Plugin for InputPlugin { .add_event::() .init_resource::() .add_systems(PreUpdate, touch_screen_input_system.in_set(InputSystems)); - - #[cfg(feature = "bevy_reflect")] - { - // Register common types - app.register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::(); - } } } diff --git a/crates/bevy_input_focus/src/directional_navigation.rs b/crates/bevy_input_focus/src/directional_navigation.rs index 2f3d64702549b..eca52febf85a6 100644 --- a/crates/bevy_input_focus/src/directional_navigation.rs +++ b/crates/bevy_input_focus/src/directional_navigation.rs @@ -36,10 +36,6 @@ pub struct DirectionalNavigationPlugin; impl Plugin for DirectionalNavigationPlugin { fn build(&self, app: &mut App) { app.init_resource::(); - - #[cfg(feature = "bevy_reflect")] - app.register_type::() - .register_type::(); } } diff --git a/crates/bevy_input_focus/src/lib.rs b/crates/bevy_input_focus/src/lib.rs index 86466869d0ee8..3d1f8851350d8 100644 --- a/crates/bevy_input_focus/src/lib.rs +++ b/crates/bevy_input_focus/src/lib.rs @@ -221,11 +221,6 @@ impl Plugin for InputDispatchPlugin { ) .in_set(InputFocusSystems::Dispatch), ); - - #[cfg(feature = "bevy_reflect")] - app.register_type::() - .register_type::() - .register_type::(); } } diff --git a/crates/bevy_input_focus/src/tab_navigation.rs b/crates/bevy_input_focus/src/tab_navigation.rs index 98cf49163fc3d..e8eb6d85ce0dc 100644 --- a/crates/bevy_input_focus/src/tab_navigation.rs +++ b/crates/bevy_input_focus/src/tab_navigation.rs @@ -345,9 +345,6 @@ pub struct TabNavigationPlugin; impl Plugin for TabNavigationPlugin { fn build(&self, app: &mut App) { app.add_systems(Startup, setup_tab_navigation); - - #[cfg(feature = "bevy_reflect")] - app.register_type::().register_type::(); app.add_observer(acquire_focus); app.add_observer(click_to_focus); } diff --git a/crates/bevy_light/src/lib.rs b/crates/bevy_light/src/lib.rs index 89d69b81083b8..5ef9ad00250f3 100644 --- a/crates/bevy_light/src/lib.rs +++ b/crates/bevy_light/src/lib.rs @@ -21,8 +21,8 @@ use core::ops::DerefMut; pub mod cluster; pub use cluster::ClusteredDecal; use cluster::{ - add_clusters, assign::assign_objects_to_clusters, ClusterConfig, - GlobalVisibleClusterableObjects, VisibleClusterableObjects, + add_clusters, assign::assign_objects_to_clusters, GlobalVisibleClusterableObjects, + VisibleClusterableObjects, }; mod ambient_light; pub use ambient_light::AmbientLight; @@ -117,24 +117,7 @@ pub struct LightPlugin; impl Plugin for LightPlugin { fn build(&self, app: &mut App) { - app.register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .init_resource::() + app.init_resource::() .init_resource::() .init_resource::() .init_resource::() diff --git a/crates/bevy_pbr/src/atmosphere/mod.rs b/crates/bevy_pbr/src/atmosphere/mod.rs index ed4dabdf9621e..4b6065c76dc7b 100644 --- a/crates/bevy_pbr/src/atmosphere/mod.rs +++ b/crates/bevy_pbr/src/atmosphere/mod.rs @@ -92,14 +92,12 @@ impl Plugin for AtmospherePlugin { embedded_asset!(app, "aerial_view_lut.wgsl"); embedded_asset!(app, "render_sky.wgsl"); - app.register_type::() - .register_type::() - .add_plugins(( - ExtractComponentPlugin::::default(), - ExtractComponentPlugin::::default(), - UniformComponentPlugin::::default(), - UniformComponentPlugin::::default(), - )); + app.add_plugins(( + ExtractComponentPlugin::::default(), + ExtractComponentPlugin::::default(), + UniformComponentPlugin::::default(), + UniformComponentPlugin::::default(), + )); } fn finish(&self, app: &mut App) { diff --git a/crates/bevy_pbr/src/decal/clustered.rs b/crates/bevy_pbr/src/decal/clustered.rs index 7580f1475e92a..2eed8f741e86d 100644 --- a/crates/bevy_pbr/src/decal/clustered.rs +++ b/crates/bevy_pbr/src/decal/clustered.rs @@ -144,8 +144,7 @@ impl Plugin for ClusteredDecalPlugin { fn build(&self, app: &mut App) { load_shader_library!(app, "clustered.wgsl"); - app.add_plugins(ExtractComponentPlugin::::default()) - .register_type::(); + app.add_plugins(ExtractComponentPlugin::::default()); let Some(render_app) = app.get_sub_app_mut(RenderApp) else { return; diff --git a/crates/bevy_pbr/src/decal/forward.rs b/crates/bevy_pbr/src/decal/forward.rs index d862331be510e..f5b24169d069e 100644 --- a/crates/bevy_pbr/src/decal/forward.rs +++ b/crates/bevy_pbr/src/decal/forward.rs @@ -30,8 +30,6 @@ impl Plugin for ForwardDecalPlugin { fn build(&self, app: &mut App) { load_shader_library!(app, "forward_decal.wgsl"); - app.register_type::(); - let mesh = app.world_mut().resource_mut::>().add( Rectangle::from_size(Vec2::ONE) .mesh() diff --git a/crates/bevy_pbr/src/lib.rs b/crates/bevy_pbr/src/lib.rs index 2947927b0cec5..6af1d6dad1b03 100644 --- a/crates/bevy_pbr/src/lib.rs +++ b/crates/bevy_pbr/src/lib.rs @@ -223,7 +223,6 @@ impl Plugin for PbrPlugin { load_shader_library!(app, "meshlet/dummy_visibility_buffer_resolve.wgsl"); app.register_asset_reflect::() - .register_type::() .init_resource::() .add_plugins(( MeshRenderPlugin { diff --git a/crates/bevy_pbr/src/render/fog.rs b/crates/bevy_pbr/src/render/fog.rs index fa091207258f2..29dfab349aa52 100644 --- a/crates/bevy_pbr/src/render/fog.rs +++ b/crates/bevy_pbr/src/render/fog.rs @@ -133,7 +133,6 @@ impl Plugin for FogPlugin { fn build(&self, app: &mut App) { load_shader_library!(app, "fog.wgsl"); - app.register_type::(); app.add_plugins(ExtractComponentPlugin::::default()); if let Some(render_app) = app.get_sub_app_mut(RenderApp) { diff --git a/crates/bevy_pbr/src/ssao/mod.rs b/crates/bevy_pbr/src/ssao/mod.rs index a1170b9604dad..d90ed010698bc 100644 --- a/crates/bevy_pbr/src/ssao/mod.rs +++ b/crates/bevy_pbr/src/ssao/mod.rs @@ -53,8 +53,6 @@ impl Plugin for ScreenSpaceAmbientOcclusionPlugin { embedded_asset!(app, "ssao.wgsl"); embedded_asset!(app, "spatial_denoise.wgsl"); - app.register_type::(); - app.add_plugins(SyncComponentPlugin::::default()); } diff --git a/crates/bevy_pbr/src/ssr/mod.rs b/crates/bevy_pbr/src/ssr/mod.rs index b245aaffb8da3..aea23f160861f 100644 --- a/crates/bevy_pbr/src/ssr/mod.rs +++ b/crates/bevy_pbr/src/ssr/mod.rs @@ -184,8 +184,7 @@ impl Plugin for ScreenSpaceReflectionsPlugin { load_shader_library!(app, "ssr.wgsl"); load_shader_library!(app, "raymarch.wgsl"); - app.register_type::() - .add_plugins(ExtractComponentPlugin::::default()); + app.add_plugins(ExtractComponentPlugin::::default()); let Some(render_app) = app.get_sub_app_mut(RenderApp) else { return; diff --git a/crates/bevy_pbr/src/wireframe.rs b/crates/bevy_pbr/src/wireframe.rs index 77257630b64b4..e8add9058d23f 100644 --- a/crates/bevy_pbr/src/wireframe.rs +++ b/crates/bevy_pbr/src/wireframe.rs @@ -89,9 +89,6 @@ impl Plugin for WireframePlugin { )) .init_asset::() .init_resource::>() - .register_type::() - .register_type::() - .register_type::() .init_resource::() .init_resource::() .add_systems(Startup, setup_global_wireframe_material) diff --git a/crates/bevy_picking/src/input.rs b/crates/bevy_picking/src/input.rs index 3050522ab5f4d..5108a849a1b79 100644 --- a/crates/bevy_picking/src/input.rs +++ b/crates/bevy_picking/src/input.rs @@ -95,7 +95,6 @@ pub struct PointerInputPlugin; impl Plugin for PointerInputPlugin { fn build(&self, app: &mut App) { app.init_resource::() - .register_type::() .add_systems(Startup, spawn_mouse_pointer) .add_systems( First, diff --git a/crates/bevy_picking/src/lib.rs b/crates/bevy_picking/src/lib.rs index 05171914f9c6e..7a0e1dfb2b82d 100644 --- a/crates/bevy_picking/src/lib.rs +++ b/crates/bevy_picking/src/lib.rs @@ -409,16 +409,7 @@ impl Plugin for PickingPlugin { PickingSystems::Last, ) .chain(), - ) - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::(); + ); } } diff --git a/crates/bevy_picking/src/mesh_picking/mod.rs b/crates/bevy_picking/src/mesh_picking/mod.rs index 8e6a16690cfdb..41b981385b7fc 100644 --- a/crates/bevy_picking/src/mesh_picking/mod.rs +++ b/crates/bevy_picking/src/mesh_picking/mod.rs @@ -25,7 +25,7 @@ use bevy_app::prelude::*; use bevy_ecs::prelude::*; use bevy_reflect::prelude::*; use bevy_render::{prelude::*, view::RenderLayers}; -use ray_cast::{MeshRayCast, MeshRayCastSettings, RayCastVisibility, SimplifiedMesh}; +use ray_cast::{MeshRayCast, MeshRayCastSettings, RayCastVisibility}; /// An optional component that marks cameras that should be used in the [`MeshPickingPlugin`]. /// @@ -69,8 +69,6 @@ pub struct MeshPickingPlugin; impl Plugin for MeshPickingPlugin { fn build(&self, app: &mut App) { app.init_resource::() - .register_type::() - .register_type::() .add_systems(PreUpdate, update_hits.in_set(PickingSystems::Backend)); } } diff --git a/crates/bevy_render/src/camera.rs b/crates/bevy_render/src/camera.rs index 03564a80fe24c..c3f720b619fca 100644 --- a/crates/bevy_render/src/camera.rs +++ b/crates/bevy_render/src/camera.rs @@ -54,10 +54,7 @@ pub struct CameraPlugin; impl Plugin for CameraPlugin { fn build(&self, app: &mut App) { - app.register_type::() - .register_type::() - .register_type::() - .register_required_components::() + app.register_required_components::() .register_required_components::() .register_required_components::() .register_required_components::() diff --git a/crates/bevy_render/src/globals.rs b/crates/bevy_render/src/globals.rs index 04e4109f098c9..b8d6810a8bb43 100644 --- a/crates/bevy_render/src/globals.rs +++ b/crates/bevy_render/src/globals.rs @@ -16,8 +16,6 @@ pub struct GlobalsPlugin; impl Plugin for GlobalsPlugin { fn build(&self, app: &mut App) { load_shader_library!(app, "globals.wgsl"); - app.register_type::(); - if let Some(render_app) = app.get_sub_app_mut(RenderApp) { render_app .init_resource::() diff --git a/crates/bevy_render/src/lib.rs b/crates/bevy_render/src/lib.rs index 0d37e99e053e9..79a769effe737 100644 --- a/crates/bevy_render/src/lib.rs +++ b/crates/bevy_render/src/lib.rs @@ -78,51 +78,48 @@ pub mod prelude { Projection, }; } -use batching::gpu_preprocessing::BatchingPlugin; #[doc(hidden)] pub mod _macro { pub use bevy_asset; } -use bevy_ecs::schedule::ScheduleBuildSettings; -use bevy_image::{CompressedImageFormatSupport, CompressedImageFormats}; -use bevy_utils::prelude::default; pub use extract_param::Extract; -use bevy_window::{PrimaryWindow, RawHandleWrapperHolder}; -use experimental::occlusion_culling::OcclusionCullingPlugin; -use globals::GlobalsPlugin; -use render_asset::{ - extract_render_asset_bytes_per_frame, reset_render_asset_bytes_per_frame, - RenderAssetBytesPerFrame, RenderAssetBytesPerFrameLimiter, -}; -use render_resource::init_empty_bind_group_layout; -use renderer::{RenderAdapter, RenderDevice, RenderQueue}; -use settings::RenderResources; -use sync_world::{ - despawn_temporary_render_entities, entity_sync_system, MainEntity, RenderEntity, - SyncToRenderWorld, SyncWorldPlugin, TemporaryRenderEntity, -}; - -use crate::gpu_readback::GpuReadbackPlugin; use crate::{ camera::CameraPlugin, + gpu_readback::GpuReadbackPlugin, mesh::{MeshPlugin, MorphPlugin, RenderMesh}, render_asset::prepare_assets, - render_resource::{PipelineCache, Shader, ShaderLoader}, + render_resource::{init_empty_bind_group_layout, PipelineCache, Shader, ShaderLoader}, renderer::{render_system, RenderInstance}, settings::RenderCreation, storage::StoragePlugin, view::{ViewPlugin, WindowRenderPlugin}, }; use alloc::sync::Arc; +use batching::gpu_preprocessing::BatchingPlugin; use bevy_app::{App, AppLabel, Plugin, SubApp}; use bevy_asset::{AssetApp, AssetServer}; -use bevy_ecs::{prelude::*, schedule::ScheduleLabel}; +use bevy_ecs::{ + prelude::*, + schedule::{ScheduleBuildSettings, ScheduleLabel}, +}; +use bevy_image::{CompressedImageFormatSupport, CompressedImageFormats}; +use bevy_utils::prelude::default; +use bevy_window::{PrimaryWindow, RawHandleWrapperHolder}; use bitflags::bitflags; use core::ops::{Deref, DerefMut}; +use experimental::occlusion_culling::OcclusionCullingPlugin; +use globals::GlobalsPlugin; +use render_asset::{ + extract_render_asset_bytes_per_frame, reset_render_asset_bytes_per_frame, + RenderAssetBytesPerFrame, RenderAssetBytesPerFrameLimiter, +}; +use renderer::{RenderAdapter, RenderDevice, RenderQueue}; +use settings::RenderResources; use std::sync::Mutex; +use sync_world::{despawn_temporary_render_entities, entity_sync_system, SyncWorldPlugin}; use tracing::debug; pub use wgpu_wrapper::WgpuWrapper; @@ -471,14 +468,6 @@ impl Plugin for RenderPlugin { render_app.add_systems(RenderStartup, init_empty_bind_group_layout); } - - app.register_type::() - // These types cannot be registered in bevy_color, as it does not depend on the rest of Bevy - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::(); } fn ready(&self, app: &App) -> bool { diff --git a/crates/bevy_render/src/mesh/mod.rs b/crates/bevy_render/src/mesh/mod.rs index f7aa593a3a8f2..f6bcfedac437a 100644 --- a/crates/bevy_render/src/mesh/mod.rs +++ b/crates/bevy_render/src/mesh/mod.rs @@ -21,36 +21,6 @@ use bevy_ecs::{ pub use bevy_mesh::{mark_3d_meshes_as_changed_if_their_assets_changed, Mesh2d, Mesh3d, MeshTag}; use wgpu::IndexFormat; -/// Registers all [`MeshBuilder`] types. -pub struct MeshBuildersPlugin; - -impl Plugin for MeshBuildersPlugin { - fn build(&self, app: &mut App) { - // 2D Mesh builders - app.register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - // 3D Mesh builders - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::(); - } -} - /// Adds the [`Mesh`] as an asset and makes sure that they are extracted and prepared for the GPU. pub struct MeshPlugin; @@ -59,10 +29,7 @@ impl Plugin for MeshPlugin { app.init_asset::() .init_asset::() .register_asset_reflect::() - .register_type::() - .register_type::() .register_type::>() - .add_plugins(MeshBuildersPlugin) // 'Mesh' must be prepared after 'Image' as meshes rely on the morph target image being ready .add_plugins(RenderAssetPlugin::::default()) .add_plugins(MeshAllocatorPlugin) @@ -86,9 +53,7 @@ impl Plugin for MeshPlugin { pub struct MorphPlugin; impl Plugin for MorphPlugin { fn build(&self, app: &mut App) { - app.register_type::() - .register_type::() - .add_systems(PostUpdate, inherit_weights); + app.add_systems(PostUpdate, inherit_weights); } } diff --git a/crates/bevy_render/src/storage.rs b/crates/bevy_render/src/storage.rs index 6084271fee27c..a07e7d845414c 100644 --- a/crates/bevy_render/src/storage.rs +++ b/crates/bevy_render/src/storage.rs @@ -18,7 +18,6 @@ pub struct StoragePlugin; impl Plugin for StoragePlugin { fn build(&self, app: &mut App) { app.add_plugins(RenderAssetPlugin::::default()) - .register_type::() .init_asset::() .register_asset_reflect::(); } diff --git a/crates/bevy_render/src/texture/mod.rs b/crates/bevy_render/src/texture/mod.rs index 78cc78a9a132f..f9e7532b7a1ac 100644 --- a/crates/bevy_render/src/texture/mod.rs +++ b/crates/bevy_render/src/texture/mod.rs @@ -82,7 +82,6 @@ impl Plugin for ImagePlugin { ExtractResourcePlugin::::default(), )) .init_resource::() - .register_type::() .init_asset::() .register_asset_reflect::(); diff --git a/crates/bevy_render/src/view/mod.rs b/crates/bevy_render/src/view/mod.rs index 6688a00f5e124..cb46c9215a085 100644 --- a/crates/bevy_render/src/view/mod.rs +++ b/crates/bevy_render/src/view/mod.rs @@ -100,9 +100,7 @@ impl Plugin for ViewPlugin { fn build(&self, app: &mut App) { load_shader_library!(app, "view.wgsl"); - app.register_type::() - .register_type::() - .register_type::() + app // NOTE: windows.is_changed() handles cases where a window was resized .add_plugins(( ExtractComponentPlugin::::default(), diff --git a/crates/bevy_render/src/view/window/screenshot.rs b/crates/bevy_render/src/view/window/screenshot.rs index a3ac1d47e0dea..789e284c66d77 100644 --- a/crates/bevy_render/src/view/window/screenshot.rs +++ b/crates/bevy_render/src/view/window/screenshot.rs @@ -401,9 +401,7 @@ impl Plugin for ScreenshotPlugin { .after(event_update_system) .before(ApplyDeferred), ) - .add_systems(Update, trigger_screenshots) - .register_type::() - .register_type::(); + .add_systems(Update, trigger_screenshots); let Some(render_app) = app.get_sub_app_mut(RenderApp) else { return; diff --git a/crates/bevy_scene/src/lib.rs b/crates/bevy_scene/src/lib.rs index b088fb9871055..4c464fc473f91 100644 --- a/crates/bevy_scene/src/lib.rs +++ b/crates/bevy_scene/src/lib.rs @@ -62,8 +62,6 @@ impl Plugin for ScenePlugin { .init_asset::() .init_asset_loader::() .init_resource::() - .register_type::() - .register_type::() .add_systems(SpawnScene, (scene_spawner, scene_spawner_system).chain()); // Register component hooks for DynamicSceneRoot diff --git a/crates/bevy_scene/src/scene_spawner.rs b/crates/bevy_scene/src/scene_spawner.rs index 5243df357a401..afd8958149e05 100644 --- a/crates/bevy_scene/src/scene_spawner.rs +++ b/crates/bevy_scene/src/scene_spawner.rs @@ -661,8 +661,7 @@ mod tests { app.add_plugins(ScheduleRunnerPlugin::default()) .add_plugins(AssetPlugin::default()) - .add_plugins(ScenePlugin) - .register_type::(); + .add_plugins(ScenePlugin); app.update(); let mut scene_world = World::new(); diff --git a/crates/bevy_solari/src/pathtracer/mod.rs b/crates/bevy_solari/src/pathtracer/mod.rs index 72affe4b048a8..3f20119761290 100644 --- a/crates/bevy_solari/src/pathtracer/mod.rs +++ b/crates/bevy_solari/src/pathtracer/mod.rs @@ -28,8 +28,6 @@ pub struct PathtracingPlugin; impl Plugin for PathtracingPlugin { fn build(&self, app: &mut App) { embedded_asset!(app, "pathtracer.wgsl"); - - app.register_type::(); } fn finish(&self, app: &mut App) { diff --git a/crates/bevy_solari/src/realtime/mod.rs b/crates/bevy_solari/src/realtime/mod.rs index 472bce67d8ead..d8993840d1e4c 100644 --- a/crates/bevy_solari/src/realtime/mod.rs +++ b/crates/bevy_solari/src/realtime/mod.rs @@ -35,8 +35,7 @@ impl Plugin for SolariLightingPlugin { embedded_asset!(app, "restir_di.wgsl"); embedded_asset!(app, "restir_gi.wgsl"); - app.register_type::() - .insert_resource(DefaultOpaqueRendererMethod::deferred()); + app.insert_resource(DefaultOpaqueRendererMethod::deferred()); } fn finish(&self, app: &mut App) { diff --git a/crates/bevy_solari/src/scene/mod.rs b/crates/bevy_solari/src/scene/mod.rs index b0aa7e512bf71..16352879a8d3a 100644 --- a/crates/bevy_solari/src/scene/mod.rs +++ b/crates/bevy_solari/src/scene/mod.rs @@ -34,8 +34,6 @@ impl Plugin for RaytracingScenePlugin { load_shader_library!(app, "brdf.wgsl"); load_shader_library!(app, "raytracing_scene_bindings.wgsl"); load_shader_library!(app, "sampling.wgsl"); - - app.register_type::(); } fn finish(&self, app: &mut App) { diff --git a/crates/bevy_sprite/src/lib.rs b/crates/bevy_sprite/src/lib.rs index 91982938949ea..01a259cf8f27d 100644 --- a/crates/bevy_sprite/src/lib.rs +++ b/crates/bevy_sprite/src/lib.rs @@ -84,28 +84,23 @@ impl Plugin for SpritePlugin { app.add_plugins(TextureAtlasPlugin); } - app.register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .add_plugins(( - Mesh2dRenderPlugin, - ColorMaterialPlugin, - TilemapChunkPlugin, - TilemapChunkMaterialPlugin, - )) - .add_systems( - PostUpdate, + app.add_plugins(( + Mesh2dRenderPlugin, + ColorMaterialPlugin, + TilemapChunkPlugin, + TilemapChunkMaterialPlugin, + )) + .add_systems( + PostUpdate, + ( + calculate_bounds_2d.in_set(VisibilitySystems::CalculateBounds), ( - calculate_bounds_2d.in_set(VisibilitySystems::CalculateBounds), - ( - compute_slices_on_asset_event.before(AssetEventSystems), - compute_slices_on_sprite_change, - ) - .in_set(SpriteSystems::ComputeSlices), - ), - ); + compute_slices_on_asset_event.before(AssetEventSystems), + compute_slices_on_sprite_change, + ) + .in_set(SpriteSystems::ComputeSlices), + ), + ); #[cfg(feature = "bevy_sprite_picking_backend")] app.add_plugins(SpritePickingPlugin); diff --git a/crates/bevy_sprite/src/mesh2d/wireframe2d.rs b/crates/bevy_sprite/src/mesh2d/wireframe2d.rs index 95a7473fec3f5..bd31b7b6d647a 100644 --- a/crates/bevy_sprite/src/mesh2d/wireframe2d.rs +++ b/crates/bevy_sprite/src/mesh2d/wireframe2d.rs @@ -87,9 +87,6 @@ impl Plugin for Wireframe2dPlugin { )) .init_asset::() .init_resource::>() - .register_type::() - .register_type::() - .register_type::() .init_resource::() .init_resource::() .add_systems(Startup, setup_global_wireframe_material) diff --git a/crates/bevy_sprite/src/picking_backend.rs b/crates/bevy_sprite/src/picking_backend.rs index cda9955b95282..3bc021b21db24 100644 --- a/crates/bevy_sprite/src/picking_backend.rs +++ b/crates/bevy_sprite/src/picking_backend.rs @@ -76,9 +76,6 @@ pub struct SpritePickingPlugin; impl Plugin for SpritePickingPlugin { fn build(&self, app: &mut App) { app.init_resource::() - .register_type::() - .register_type::() - .register_type::() .add_systems(PreUpdate, sprite_picking.in_set(PickingSystems::Backend)); } } diff --git a/crates/bevy_sprite/src/tilemap_chunk/mod.rs b/crates/bevy_sprite/src/tilemap_chunk/mod.rs index a7a0f7d419099..005e61e6a75c4 100644 --- a/crates/bevy_sprite/src/tilemap_chunk/mod.rs +++ b/crates/bevy_sprite/src/tilemap_chunk/mod.rs @@ -31,10 +31,7 @@ pub struct TilemapChunkPlugin; impl Plugin for TilemapChunkPlugin { fn build(&self, app: &mut App) { - app.register_type::() - .register_type::() - .register_type::() - .init_resource::() + app.init_resource::() .add_systems(Update, update_tilemap_chunk_indices); } } diff --git a/crates/bevy_text/src/lib.rs b/crates/bevy_text/src/lib.rs index 71b82a03f4741..46af2b04242c5 100644 --- a/crates/bevy_text/src/lib.rs +++ b/crates/bevy_text/src/lib.rs @@ -96,16 +96,6 @@ pub type Update2dText = Text2dUpdateSystems; impl Plugin for TextPlugin { fn build(&self, app: &mut App) { app.init_asset::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() .init_asset_loader::() .init_resource::() .init_resource::() diff --git a/crates/bevy_time/src/lib.rs b/crates/bevy_time/src/lib.rs index 8173b7c91b8e2..792f9f03b284a 100644 --- a/crates/bevy_time/src/lib.rs +++ b/crates/bevy_time/src/lib.rs @@ -76,8 +76,7 @@ impl Plugin for TimePlugin { app.register_type::