Skip to content

Commit 595ef3e

Browse files
kfc35mate-h
authored andcommitted
fix(RenderDebugOverlayPlugin): Require the bevy_pbr feature for inclusion in DefaultPlugins (bevyengine#23766)
# Objective - Fixes bevyengine#23673 - The `RenderDebugOverlayPlugin` is a `DefaultPlugin` that currently only requires the `bevy_dev_tools` feature. However, under the hood in its `init_render_debug_overlay_pipeline` system, it requires the `MeshPipelineViewLayouts` resource to be initialized. The resource is initialized in the `MeshRenderPlugin` (system `init_mesh_pipeline_view_layouts`). The `MeshRenderPlugin` is part of the `PbrPlugin`, which is a plugin in `DefaultPlugins` that requires the `bevy_pbr` feature. This causes an error when you have a bevy project with `DefaultPlugins`, without default features, and have the `bevy_dev_tools` feature enabled. ## Solution - The `RenderDebugOverlayPlugin` additionally requires the `bevy_pbr` feature so that it can be included in `DefaultPlugins`. This ensures `MeshPipelineViewLayouts` is initialized so that `RenderDebugOverlayPlugin` can properly initialize. - If `RenderDebugOverlayPlugin` can be more dexterously changed to still be enabled with just the `bevy_dev_tools` feature, and `bevy_pbr` specific logic can be handled within the plugin itself, then this can PR can be rejected. ## Testing - I created a scratch bevy project with the configuration described in the linked issue, but pointing to this branch fix for its bevy dependency. It successfully runs.
1 parent 18c53e2 commit 595ef3e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

crates/bevy_internal/src/default_plugins.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ plugin_group! {
8989
bevy_state::app:::StatesPlugin,
9090
#[cfg(feature = "bevy_ci_testing")]
9191
bevy_dev_tools::ci_testing:::CiTestingPlugin,
92-
#[cfg(feature = "bevy_dev_tools")]
92+
#[custom(cfg(all(feature = "bevy_dev_tools", feature = "bevy_pbr")))]
9393
bevy_dev_tools::render_debug:::RenderDebugOverlayPlugin,
9494
#[cfg(feature = "hotpatching")]
9595
bevy_app::hotpatch:::HotPatchPlugin,

0 commit comments

Comments
 (0)