Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions crates/bevy_animation/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand All @@ -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;

Expand Down Expand Up @@ -1234,12 +1233,6 @@ impl Plugin for AnimationPlugin {
.init_asset_loader::<AnimationGraphAssetLoader>()
.register_asset_reflect::<AnimationClip>()
.register_asset_reflect::<AnimationGraph>()
.register_type::<AnimationPlayer>()
.register_type::<AnimationTarget>()
.register_type::<AnimationTransitions>()
.register_type::<AnimationGraphHandle>()
.register_type::<NodeIndex>()
.register_type::<ThreadedAnimationGraphs>()
.init_resource::<ThreadedAnimationGraphs>()
.add_systems(
PostUpdate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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::<ContrastAdaptiveSharpening>();
app.add_plugins((
ExtractComponentPlugin::<ContrastAdaptiveSharpening>::default(),
UniformComponentPlugin::<CasUniform>::default(),
Expand Down
1 change: 0 additions & 1 deletion crates/bevy_anti_aliasing/src/fxaa/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ impl Plugin for FxaaPlugin {
fn build(&self, app: &mut App) {
embedded_asset!(app, "fxaa.wgsl");

app.register_type::<Fxaa>();
app.add_plugins(ExtractComponentPlugin::<Fxaa>::default());

let Some(render_app) = app.get_sub_app_mut(RenderApp) else {
Expand Down
3 changes: 1 addition & 2 deletions crates/bevy_anti_aliasing/src/smaa/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,7 @@ impl Plugin for SmaaPlugin {
}
};

app.add_plugins(ExtractComponentPlugin::<Smaa>::default())
.register_type::<Smaa>();
app.add_plugins(ExtractComponentPlugin::<Smaa>::default());

let Some(render_app) = app.get_sub_app_mut(RenderApp) else {
return;
Expand Down
2 changes: 0 additions & 2 deletions crates/bevy_anti_aliasing/src/taa/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ impl Plugin for TemporalAntiAliasPlugin {
fn build(&self, app: &mut App) {
embedded_asset!(app, "taa.wgsl");

app.register_type::<TemporalAntiAliasing>();

app.add_plugins(SyncComponentPlugin::<TemporalAntiAliasing>::default());

let Some(render_app) = app.get_sub_app_mut(RenderApp) else {
Expand Down
7 changes: 0 additions & 7 deletions crates/bevy_app/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<AppTypeRegistry>();

#[cfg(feature = "reflect_auto_register")]
app.insert_resource(AppTypeRegistry::new_with_derived_types());

app.register_type::<Name>();
app.register_type::<ChildOf>();
app.register_type::<Children>();
app.register_type::<ObservedBy>();
}

#[cfg(feature = "reflect_functions")]
Expand Down
3 changes: 1 addition & 2 deletions crates/bevy_asset/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<AssetPath>();
.add_systems(PreUpdate, handle_internal_asset_events.ambiguous_with_all());
}
}

Expand Down
8 changes: 1 addition & 7 deletions crates/bevy_audio/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,7 @@ pub struct AudioPlugin {

impl Plugin for AudioPlugin {
fn build(&self, app: &mut App) {
app.register_type::<Volume>()
.register_type::<GlobalVolume>()
.register_type::<SpatialListener>()
.register_type::<DefaultSpatialScale>()
.register_type::<PlaybackMode>()
.register_type::<PlaybackSettings>()
.insert_resource(self.global_volume)
app.insert_resource(self.global_volume)
.insert_resource(DefaultSpatialScale(self.default_spatial_scale))
.configure_sets(
PostUpdate,
Expand Down
20 changes: 5 additions & 15 deletions crates/bevy_camera/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,10 @@ pub struct CameraPlugin;

impl Plugin for CameraPlugin {
fn build(&self, app: &mut App) {
app.register_type::<Camera>()
.register_type::<ClearColor>()
.register_type::<CameraMainTextureUsages>()
.register_type::<Exposure>()
.register_type::<MainPassResolutionOverride>()
.register_type::<primitives::Aabb>()
.register_type::<primitives::CascadesFrusta>()
.register_type::<primitives::CubemapFrusta>()
.register_type::<primitives::Frustum>()
.init_resource::<ClearColor>()
.add_plugins((
CameraProjectionPlugin,
visibility::VisibilityPlugin,
visibility::VisibilityRangePlugin,
));
app.init_resource::<ClearColor>().add_plugins((
CameraProjectionPlugin,
visibility::VisibilityPlugin,
visibility::VisibilityRangePlugin,
));
}
}
16 changes: 6 additions & 10 deletions crates/bevy_camera/src/projection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,12 @@ pub struct CameraProjectionPlugin;

impl Plugin for CameraProjectionPlugin {
fn build(&self, app: &mut App) {
app.register_type::<Projection>()
.register_type::<PerspectiveProjection>()
.register_type::<OrthographicProjection>()
.register_type::<CustomProjection>()
.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),
);
}
}

Expand Down
12 changes: 1 addition & 11 deletions crates/bevy_camera/src/visibility/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,17 +340,7 @@ impl Plugin for VisibilityPlugin {
fn build(&self, app: &mut bevy_app::App) {
use VisibilitySystems::*;

app.register_type::<VisibilityClass>()
.register_type::<InheritedVisibility>()
.register_type::<ViewVisibility>()
.register_type::<NoFrustumCulling>()
.register_type::<RenderLayers>()
.register_type::<Visibility>()
.register_type::<VisibleEntities>()
.register_type::<CascadesVisibleEntities>()
.register_type::<VisibleMeshEntities>()
.register_type::<CubemapVisibleEntities>()
.register_required_components::<Mesh3d, Visibility>()
app.register_required_components::<Mesh3d, Visibility>()
.register_required_components::<Mesh3d, VisibilityClass>()
.register_required_components::<Mesh2d, Visibility>()
.register_required_components::<Mesh2d, VisibilityClass>()
Expand Down
14 changes: 6 additions & 8 deletions crates/bevy_camera/src/visibility/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,12 @@ pub struct VisibilityRangePlugin;

impl Plugin for VisibilityRangePlugin {
fn build(&self, app: &mut App) {
app.register_type::<VisibilityRange>()
.init_resource::<VisibleEntityRanges>()
.add_systems(
PostUpdate,
check_visibility_ranges
.in_set(VisibilitySystems::CheckVisibility)
.before(check_visibility),
);
app.init_resource::<VisibleEntityRanges>().add_systems(
PostUpdate,
check_visibility_ranges
.in_set(VisibilitySystems::CheckVisibility)
.before(check_visibility),
);
}
}

Expand Down
2 changes: 0 additions & 2 deletions crates/bevy_core_pipeline/src/auto_exposure/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,12 @@ impl Plugin for AutoExposurePlugin {
embedded_asset!(app, "auto_exposure.wgsl");

app.add_plugins(RenderAssetPlugin::<GpuAutoExposureCompensationCurve>::default())
.register_type::<AutoExposureCompensationCurve>()
.init_asset::<AutoExposureCompensationCurve>()
.register_asset_reflect::<AutoExposureCompensationCurve>();
app.world_mut()
.resource_mut::<Assets<AutoExposureCompensationCurve>>()
.insert(&Handle::default(), AutoExposureCompensationCurve::default());

app.register_type::<AutoExposure>();
app.add_plugins(ExtractComponentPlugin::<AutoExposure>::default());

let Some(render_app) = app.get_sub_app_mut(RenderApp) else {
Expand Down
3 changes: 0 additions & 3 deletions crates/bevy_core_pipeline/src/bloom/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ impl Plugin for BloomPlugin {
fn build(&self, app: &mut App) {
embedded_asset!(app, "bloom.wgsl");

app.register_type::<Bloom>();
app.register_type::<BloomPrefilter>();
app.register_type::<BloomCompositeMode>();
app.add_plugins((
ExtractComponentPlugin::<Bloom>::default(),
UniformComponentPlugin::<BloomUniforms>::default(),
Expand Down
3 changes: 1 addition & 2 deletions crates/bevy_core_pipeline/src/core_2d/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ pub struct Core2dPlugin;

impl Plugin for Core2dPlugin {
fn build(&self, app: &mut App) {
app.register_type::<Camera2d>()
.register_required_components::<Camera2d, DebandDither>()
app.register_required_components::<Camera2d, DebandDither>()
.register_required_components_with::<Camera2d, CameraRenderGraph>(|| {
CameraRenderGraph::new(Core2d)
})
Expand Down
4 changes: 1 addition & 3 deletions crates/bevy_core_pipeline/src/core_3d/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,7 @@ pub struct Core3dPlugin;

impl Plugin for Core3dPlugin {
fn build(&self, app: &mut App) {
app.register_type::<Camera3d>()
.register_type::<ScreenSpaceTransmissionQuality>()
.register_required_components_with::<Camera3d, DebandDither>(|| DebandDither::Enabled)
app.register_required_components_with::<Camera3d, DebandDither>(|| DebandDither::Enabled)
.register_required_components_with::<Camera3d, CameraRenderGraph>(|| {
CameraRenderGraph::new(Core3d)
})
Expand Down
2 changes: 0 additions & 2 deletions crates/bevy_core_pipeline/src/dof/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,6 @@ impl Plugin for DepthOfFieldPlugin {
fn build(&self, app: &mut App) {
embedded_asset!(app, "dof.wgsl");

app.register_type::<DepthOfField>();
app.register_type::<DepthOfFieldMode>();
app.add_plugins(UniformComponentPlugin::<DepthOfFieldUniform>::default());

app.add_plugins(SyncComponentPlugin::<DepthOfField>::default());
Expand Down
25 changes: 6 additions & 19 deletions crates/bevy_core_pipeline/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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::<DepthPrepass>()
.register_type::<NormalPrepass>()
.register_type::<MotionVectorPrepass>()
.register_type::<DeferredPrepass>()
.init_resource::<FullscreenShader>()
.add_plugins((Core2dPlugin, Core3dPlugin, CopyDeferredLightingIdPlugin))
app.add_plugins((Core2dPlugin, Core3dPlugin, CopyDeferredLightingIdPlugin))
.add_plugins((
BlitPlugin,
MsaaWritebackPlugin,
Expand Down
3 changes: 1 addition & 2 deletions crates/bevy_core_pipeline/src/oit/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ impl Plugin for OrderIndependentTransparencyPlugin {
OitResolvePlugin,
))
.add_systems(Update, check_msaa)
.add_systems(Last, configure_depth_texture_usages)
.register_type::<OrderIndependentTransparencySettings>();
.add_systems(Last, configure_depth_texture_usages);

let Some(render_app) = app.get_sub_app_mut(RenderApp) else {
return;
Expand Down
1 change: 0 additions & 1 deletion crates/bevy_core_pipeline/src/post_process/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ impl Plugin for PostProcessingPlugin {
RenderAssetUsages::RENDER_WORLD,
));

app.register_type::<ChromaticAberration>();
app.add_plugins(ExtractComponentPlugin::<ChromaticAberration>::default());

let Some(render_app) = app.get_sub_app_mut(RenderApp) else {
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_core_pipeline/src/skybox/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl Plugin for SkyboxPlugin {
embedded_asset!(app, "skybox.wgsl");
embedded_asset!(app, "skybox_prepass.wgsl");

app.register_type::<Skybox>().add_plugins((
app.add_plugins((
ExtractComponentPlugin::<Skybox>::default(),
UniformComponentPlugin::<SkyboxUniforms>::default(),
));
Expand Down
3 changes: 0 additions & 3 deletions crates/bevy_core_pipeline/src/tonemapping/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,6 @@ impl Plugin for TonemappingPlugin {

app.add_plugins(ExtractResourcePlugin::<TonemappingLuts>::default());

app.register_type::<Tonemapping>();
app.register_type::<DebandDither>();

app.add_plugins((
ExtractComponentPlugin::<Tonemapping>::default(),
ExtractComponentPlugin::<DebandDither>::default(),
Expand Down
24 changes: 11 additions & 13 deletions crates/bevy_gizmos/src/aabb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,17 @@ pub struct AabbGizmoPlugin;

impl Plugin for AabbGizmoPlugin {
fn build(&self, app: &mut bevy_app::App) {
app.register_type::<AabbGizmoConfigGroup>()
.init_gizmo_group::<AabbGizmoConfigGroup>()
.add_systems(
PostUpdate,
(
draw_aabbs,
draw_all_aabbs.run_if(|config: Res<GizmoConfigStore>| {
config.config::<AabbGizmoConfigGroup>().1.draw_all
}),
)
.after(bevy_render::view::VisibilitySystems::CalculateBounds)
.after(TransformSystems::Propagate),
);
app.init_gizmo_group::<AabbGizmoConfigGroup>().add_systems(
PostUpdate,
(
draw_aabbs,
draw_all_aabbs.run_if(|config: Res<GizmoConfigStore>| {
config.config::<AabbGizmoConfigGroup>().1.draw_all
}),
)
.after(bevy_render::view::VisibilitySystems::CalculateBounds)
.after(TransformSystems::Propagate),
);
}
}
/// The [`GizmoConfigGroup`] used for debug visualizations of [`Aabb`] components on entities
Expand Down
4 changes: 1 addition & 3 deletions crates/bevy_gizmos/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,7 @@ impl Plugin for GizmoPlugin {
embedded_asset!(app, "line_joints.wgsl");
}

app.register_type::<GizmoConfig>()
.register_type::<GizmoConfigStore>()
.init_asset::<GizmoAsset>()
app.init_asset::<GizmoAsset>()
.init_resource::<GizmoHandles>()
// We insert the Resource GizmoConfigStore into the world implicitly here if it does not exist.
.init_gizmo_group::<DefaultGizmoConfigGroup>();
Expand Down
22 changes: 10 additions & 12 deletions crates/bevy_gizmos/src/light.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,18 +116,16 @@ pub struct LightGizmoPlugin;

impl Plugin for LightGizmoPlugin {
fn build(&self, app: &mut bevy_app::App) {
app.register_type::<LightGizmoConfigGroup>()
.init_gizmo_group::<LightGizmoConfigGroup>()
.add_systems(
PostUpdate,
(
draw_lights,
draw_all_lights.run_if(|config: Res<GizmoConfigStore>| {
config.config::<LightGizmoConfigGroup>().1.draw_all
}),
)
.after(TransformSystems::Propagate),
);
app.init_gizmo_group::<LightGizmoConfigGroup>().add_systems(
PostUpdate,
(
draw_lights,
draw_all_lights.run_if(|config: Res<GizmoConfigStore>| {
config.config::<LightGizmoConfigGroup>().1.draw_all
}),
)
.after(TransformSystems::Propagate),
);
}
}

Expand Down
Loading
Loading