{"record":{"id":"4f6707fd90a06fbf","repo":"bevyengine/bevy","slug":"bindless-resources-are-incompatible-with-implement","errorCode":null,"errorMessage":"Bindless resources are incompatible with implementing `as_bind_group` directly; implement `unprepared_bind_group` instead or disable bindless","messagePattern":"Bindless resources are incompatible with implementing `as_bind_group` directly; implement `unprepared_bind_group` instead or disable bindless","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/bevy_render/src/material_bind_groups.rs","lineNumber":635,"sourceCode":"    }\n\n    /// Places a pre-prepared bind group into a slab.\n    ///\n    /// For bindless materials, the allocator internally manages the bind\n    /// groups, so calling this method will panic if this is a bindless\n    /// allocator. Only non-bindless allocators support this method.\n    ///\n    /// It's generally preferred to use [`Self::allocate_unprepared`], because\n    /// that method supports both bindless and non-bindless allocators. Only use\n    /// this method if you need to prepare the bind group yourself.\n    pub fn allocate_prepared(\n        &mut self,\n        prepared_bind_group: PreparedBindGroup,\n        bind_group_layout: BindGroupLayoutDescriptor,\n    ) -> MaterialBindingId {\n        match *self {\n            MaterialBindGroupAllocator::Bindless(_) => {\n                panic!(\n                    \"Bindless resources are incompatible with implementing `as_bind_group` \\\n                     directly; implement `unprepared_bind_group` instead or disable bindless\"\n                )\n            }\n            MaterialBindGroupAllocator::NonBindless(ref mut non_bindless_allocator) => {\n                non_bindless_allocator.allocate_prepared(prepared_bind_group, bind_group_layout)\n            }\n        }\n    }\n\n    /// Deallocates the material with the given binding ID.\n    ///\n    /// Any resources that are no longer referenced are removed from the slab.\n    pub fn free(&mut self, material_binding_id: MaterialBindingId) {\n        match *self {\n            MaterialBindGroupAllocator::Bindless(\n                ref mut material_bind_group_bindless_allocator,\n            ) => material_bind_group_bindless_allocator.free(material_binding_id),","sourceCodeStart":617,"sourceCodeEnd":653,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_render/src/material_bind_groups.rs#L617-L653","documentation":"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.","triggerScenarios":"Thrown at crates/bevy_render/src/material_bind_groups.rs:635 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Implement unprepared_bind_group instead of as_bind_group","Disable bindless for this material"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"396ca727080776bd313bb892423b7d94e03b81b4","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}