bevyengine/bevy · error

Bindless resources are incompatible with implementing `as_bi

Error message

Bindless resources are incompatible with implementing `as_bind_group` directly; implement `unprepared_bind_group` instead or disable bindless

What it means

Panic/guard in MaterialBindGroupAllocator: bindless resources were used together with a manual as_bind_group implementation — bindless requires unprepared_bind_group so the allocator can manage bind group arrays, or bindless must be disabled.

Source

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

    }

    /// Places a pre-prepared bind group into a slab.
    ///
    /// For bindless materials, the allocator internally manages the bind
    /// groups, so calling this method will panic if this is a bindless
    /// allocator. Only non-bindless allocators support this method.
    ///
    /// It's generally preferred to use [`Self::allocate_unprepared`], because
    /// that method supports both bindless and non-bindless allocators. Only use
    /// this method if you need to prepare the bind group yourself.
    pub fn allocate_prepared(
        &mut self,
        prepared_bind_group: PreparedBindGroup,
        bind_group_layout: BindGroupLayoutDescriptor,
    ) -> MaterialBindingId {
        match *self {
            MaterialBindGroupAllocator::Bindless(_) => {
                panic!(
                    "Bindless resources are incompatible with implementing `as_bind_group` \
                     directly; implement `unprepared_bind_group` instead or disable bindless"
                )
            }
            MaterialBindGroupAllocator::NonBindless(ref mut non_bindless_allocator) => {
                non_bindless_allocator.allocate_prepared(prepared_bind_group, bind_group_layout)
            }
        }
    }

    /// Deallocates the material with the given binding ID.
    ///
    /// Any resources that are no longer referenced are removed from the slab.
    pub fn free(&mut self, material_binding_id: MaterialBindingId) {
        match *self {
            MaterialBindGroupAllocator::Bindless(
                ref mut material_bind_group_bindless_allocator,
            ) => material_bind_group_bindless_allocator.free(material_binding_id),

View on GitHub (pinned to 396ca72708)

Solutions

  1. Implement unprepared_bind_group instead of as_bind_group
  2. Disable bindless for this material
Defensive patterns

Strategy: validation

When it happens

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