bevyengine/bevy · error

Texture bindless resource type must have a binding number

Error message

Texture bindless resource type must have a binding number

What it means

Internal invariant expect while building texture binding arrays for bindless materials: a texture BindlessResourceType has no binding number in the bindless descriptor, so the binding cannot be placed in the layout.

Source

Thrown at crates/bevy_render/src/material_bind_groups.rs:1909

            (BindlessResourceType::TextureCube, &fallback_image.cube),
            (
                BindlessResourceType::TextureCubeArray,
                &fallback_image.cube_array,
            ),
        ] {
            // Skip texture types that this material doesn't use.
            if !bindless_descriptor
                .resources
                .contains(&bindless_resource_type)
            {
                continue;
            }

            let mut texture_bindings = vec![];

            let binding_number = bindless_resource_type
                .binding_number()
                .expect("Texture bindless resource type must have a binding number");

            match self.textures.get(&bindless_resource_type) {
                Some(texture_bindless_binding_array) => {
                    for maybe_bindless_binding in texture_bindless_binding_array.bindings.iter() {
                        match *maybe_bindless_binding {
                            Some(ref bindless_binding) => {
                                texture_bindings.push(&*bindless_binding.resource);
                            }
                            None => texture_bindings.push(&*fallback_image.texture_view),
                        }
                    }
                }

                None => {
                    // Fill with a single fallback image.
                    texture_bindings.push(&*fallback_image.texture_view);
                }
            }

View on GitHub (pinned to 396ca72708)

Solutions

  1. Report as a Bevy engine bug with a reproducing material/shader
  2. Check that the material's bindless descriptor is generated consistently for textures
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at crates/bevy_render/src/material_bind_groups.rs:1909 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of bevyengine/bevy@396ca72708 (2026-08-20). Data as JSON: /api/errors/7f4f4e82f302eb2b. Report an issue: GitHub.