bevyengine/bevy · error

Data buffer should exist with that bindless index

Error message

Data buffer should exist with that bindless index

What it means

Internal invariant expect in the bindless allocator's free path: a shader-data buffer entry was being freed under a bindless index that has no recorded data buffer, indicating allocator state corruption.

Source

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

            // Free the binding. If the resource in question was anything other
            // than a data buffer, then it has a reference count and
            // consequently we need to decrement it.
            let decrement_allocated_resource_count = match *bindless_resource_type {
                BindlessResourceType::None => false,
                BindlessResourceType::Buffer => self
                    .buffers
                    .get_mut(&bindless_index)
                    .expect("Buffer should exist with that bindless index")
                    .remove(bindless_binding),
                BindlessResourceType::ShaderBuffer => self
                    .shader_buffers
                    .get_mut(&bindless_index)
                    .expect("Shader buffer should exist with that bindless index")
                    .remove(bindless_binding),
                BindlessResourceType::DataBuffer => {
                    self.data_buffers
                        .get_mut(&bindless_index)
                        .expect("Data buffer should exist with that bindless index")
                        .remove(bindless_binding);
                    false
                }
                BindlessResourceType::SamplerFiltering
                | BindlessResourceType::SamplerNonFiltering
                | BindlessResourceType::SamplerComparison => self
                    .samplers
                    .get_mut(bindless_resource_type)
                    .expect("Sampler array should exist")
                    .remove(bindless_binding),
                BindlessResourceType::Texture1d
                | BindlessResourceType::Texture2d
                | BindlessResourceType::Texture2dArray
                | BindlessResourceType::Texture3d
                | BindlessResourceType::TextureCube
                | BindlessResourceType::TextureCubeArray => self
                    .textures
                    .get_mut(bindless_resource_type)

View on GitHub (pinned to 396ca72708)

Solutions

  1. Report as a Bevy engine bug with a reproducing project
  2. Avoid the sequence of material add/remove operations that triggers it
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at crates/bevy_render/src/material_bind_groups.rs:1412 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/fcf6ef83a9ad7f93. Report an issue: GitHub.