{"record":{"id":"94b1d25181506315","repo":"bevyengine/bevy","slug":"could-not-pack-textures-into-an-atlas-within-the-g","errorCode":null,"errorMessage":"could not pack textures into an atlas within the given bounds","messagePattern":"could not pack textures into an atlas within the given bounds","errorType":"exception","errorClass":"TextureAtlasBuilderError","httpStatus":null,"severity":"error","filePath":"crates/bevy_image/src/texture_atlas_builder.rs","lineNumber":19,"sourceCode":"use bevy_asset::{AssetId, RenderAssetUsages};\nuse bevy_math::{URect, UVec2};\nuse bevy_platform::collections::HashMap;\nuse rectangle_pack::{\n    contains_smallest_box, pack_rects, volume_heuristic, GroupedRectsToPlace, PackedLocation,\n    RectToInsert, TargetBin,\n};\nuse thiserror::Error;\nuse tracing::{debug, error, warn};\nuse wgpu_types::{Extent3d, TextureDimension, TextureFormat};\n\nuse crate::{Image, TextureAccessError, TextureFormatPixelInfo};\nuse crate::{TextureAtlasLayout, TextureAtlasSources};\n\n/// Errors returned by [`TextureAtlasBuilder`].\n#[derive(Debug, Error)]\npub enum TextureAtlasBuilderError {\n    /// The atlas texture wasn't large enough to fit the texture\n    #[error(\"could not pack textures into an atlas within the given bounds\")]\n    NotEnoughSpace,\n    /// Attempted to add a texture with a different format\n    #[error(\"added a texture with the wrong format in an atlas\")]\n    WrongFormat,\n    /// Attempted to add a texture to an uninitialized atlas\n    #[error(\"cannot add texture to uninitialized atlas texture\")]\n    UninitializedAtlas,\n    /// Attempted to add an uninitialized texture to an atlas\n    #[error(\"cannot add uninitialized texture to atlas\")]\n    UninitializedSourceTexture,\n    /// A texture access error occurred\n    #[error(\"texture access error: {0}\")]\n    TextureAccess(#[from] TextureAccessError),\n}\n\n#[derive(Debug)]\n#[must_use]\n/// A builder which is used to create a texture atlas from many individual","sourceCodeStart":1,"sourceCodeEnd":37,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_image/src/texture_atlas_builder.rs#L1-L37","documentation":"TextureAtlasBuilderError::NotEnoughSpace — rectangle-packing failed to place all submitted textures inside the atlas bin of the configured padding/p max size. Fires when total texture area plus padding exceeds the atlas dimensions; enlarge the atlas or reduce input texture sizes/count.","triggerScenarios":"Thrown at crates/bevy_image/src/texture_atlas_builder.rs:19 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Increase max_size on the TextureAtlasBuilder","Reduce the number or size of textures added to the atlas","Split the textures across multiple atlases"],"exampleFix":null,"handlingStrategy":"retry","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-14T05:17:10.506Z"}