Skip to content

Clustered light or decal had no assigned index error in light_textures example #22957

@Breakdown-Dog

Description

@Breakdown-Dog

Bevy version and features

  • main branch

What you did

Run example light_textures

What went wrong

2026-02-14T17:07:21.230773Z ERROR bevy_pbr::cluster: Clustered light or decal 296v0 had no assigned index!
2026-02-14T17:07:21.230835Z ERROR bevy_pbr::cluster: Clustered light or decal 296v0 had no assigned index!
2026-02-14T17:07:21.230897Z ERROR bevy_pbr::cluster: Clustered light or decal 296v0 had no assigned index!

The code that outputs the error message.

ExtractedClusterableObjectElement::Light(entity)
| ExtractedClusterableObjectElement::Decal(entity) => {
    if let Some(clusterable_object_index) =
          global_clusterable_object_meta.entity_to_index.get(entity)
    {
        if view_clusters_bindings.n_indices() >= ViewClusterBindings::MAX_INDICES
            && !supports_storage_buffers
        {
            warn!(
                "Clusterable object index lists are full! The clusterable \
                 objects in the view are present in too many clusters."
            );
            break;
        }
        view_clusters_bindings.push_index(*clusterable_object_index);
    } else {
        // This should never happen. The appropriate systems
        // should have populated
        // `global_clusterable_object_meta` by now.
        error!(
            "Clustered light or decal {:?} had no assigned index!",
            entity
        );
        view_clusters_bindings.push_dummy_index();
    }
}

I’m not sure what’s going on here, especially since the comment states "This should never happen." I noticed @pcwalton has been working in this area recently, so maybe could take a look?

It seems that global_clusterable_object_meta is not being populated correctly, as entity_to_index is empty.

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    Status

    Needs SME Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions