Skip to content

RenderShadowLodOrigin causes crash when not using PBR feature #24352

Description

@laundmo

When not using the PBR feature, RenderShadowLodOrigin causes a panic:

Encountered an error in system `bevy_render::view::prepare_view_uniforms`:
  Parameter `Res<'_, RenderShadowLodOrigin>` failed validation: 
    Resource does not exist

When using bevy_render but not bevy_pbr. This affects all apps which just use the 2d feature set or a similar configuration of features which omits bevy_pbr.

Used here:

shadow_lod_origin: Res<RenderShadowLodOrigin>,

Initialized here in PbrPlugin:

.init_resource::<RenderShadowLodOrigin>()

PbrPlugin uses feature bevy_pbr:
#[cfg(feature = "bevy_pbr")]
bevy_pbr:::PbrPlugin,

System registered here in ViewPlugin which is added by RenderPlugin:

prepare_view_uniforms.in_set(RenderSystems::PrepareResources),

RenderPlugin uses feature bevy_render
#[cfg(feature = "bevy_render")]
bevy_render:::RenderPlugin,

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-RenderingDrawing game state to the screenC-BugAn unexpected or incorrect behaviorP-CrashA sudden unexpected crashS-Needs-InvestigationThis issue requires detective work to figure out what's going wrong

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions