{"record":{"id":"3912b733398ca9e1","repo":"bevyengine/bevy","slug":"sampler-array-should-exist","errorCode":null,"errorMessage":"Sampler array should exist","messagePattern":"Sampler array should exist","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/bevy_render/src/material_bind_groups.rs","lineNumber":1421,"sourceCode":"                    .remove(bindless_binding),\n                BindlessResourceType::ShaderBuffer => self\n                    .shader_buffers\n                    .get_mut(&bindless_index)\n                    .expect(\"Shader buffer should exist with that bindless index\")\n                    .remove(bindless_binding),\n                BindlessResourceType::DataBuffer => {\n                    self.data_buffers\n                        .get_mut(&bindless_index)\n                        .expect(\"Data buffer should exist with that bindless index\")\n                        .remove(bindless_binding);\n                    false\n                }\n                BindlessResourceType::SamplerFiltering\n                | BindlessResourceType::SamplerNonFiltering\n                | BindlessResourceType::SamplerComparison => self\n                    .samplers\n                    .get_mut(bindless_resource_type)\n                    .expect(\"Sampler array should exist\")\n                    .remove(bindless_binding),\n                BindlessResourceType::Texture1d\n                | BindlessResourceType::Texture2d\n                | BindlessResourceType::Texture2dArray\n                | BindlessResourceType::Texture3d\n                | BindlessResourceType::TextureCube\n                | BindlessResourceType::TextureCubeArray => self\n                    .textures\n                    .get_mut(bindless_resource_type)\n                    .expect(\"Texture array should exist\")\n                    .remove(bindless_binding),\n            };\n\n            // If the slot is now free, decrement the allocated resource\n            // count.\n            if decrement_allocated_resource_count {\n                self.allocated_resource_count -= 1;\n            }","sourceCodeStart":1403,"sourceCodeEnd":1439,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_render/src/material_bind_groups.rs#L1403-L1439","documentation":"Internal invariant panic in bindless resource cleanup: the samplers slot array for a BindlessResourceType had no entry when removing a binding. Indicates bindless state bookkeeping corruption (slot removed twice or never allocated); typically unreachable in correct usage.","triggerScenarios":"Thrown at crates/bevy_render/src/material_bind_groups.rs:1421 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Report as a Bevy engine bug with a reproducing project","Avoid the material configuration that triggers the state mismatch"],"exampleFix":null,"handlingStrategy":"fallback","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"}