{"record":{"id":"37a098b5932e05a2","repo":"bevyengine/bevy","slug":"texture-format-is-not-supported-by-the-pipeline-37a098","errorCode":null,"errorMessage":"Texture format is not supported by the pipeline","messagePattern":"Texture format is not supported by the pipeline","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/bevy_sprite_render/src/render/mod.rs","lineNumber":145,"sourceCode":"    #[inline]\n    pub const fn from_msaa_samples(msaa_samples: u32) -> Self {\n        let msaa_bits =\n            (msaa_samples.trailing_zeros() & Self::MSAA_MASK_BITS) << Self::MSAA_SHIFT_BITS;\n        Self::from_bits_retain(msaa_bits)\n    }\n\n    #[inline]\n    pub const fn msaa_samples(&self) -> u32 {\n        1 << ((self.bits() >> Self::MSAA_SHIFT_BITS) & Self::MSAA_MASK_BITS)\n    }\n\n    /// Create a pipeline key from the view's color target format.\n    #[inline]\n    pub fn from_target_format(format: TextureFormat) -> Self {\n        let code = texture_format_to_code(format)\n            .expect(\"Texture format is not supported by the pipeline\") as u32;\n        Self::from_bits_retain(\n            (code & Self::COLOR_TARGET_FORMAT_MASK_BITS) << Self::COLOR_TARGET_FORMAT_SHIFT_BITS,\n        )\n    }\n\n    /// Color target format of the main pass for this pipeline key.\n    #[inline]\n    pub fn target_format(&self) -> TextureFormat {\n        let code = ((self.bits() >> Self::COLOR_TARGET_FORMAT_SHIFT_BITS)\n            & Self::COLOR_TARGET_FORMAT_MASK_BITS) as u8;\n        texture_format_from_code(code)\n            .expect(\"Unknown bits in `COLOR_TARGET_FORMAT_MASK_BITS` of the pipeline key\")\n    }\n\n    /// Key bits for a view's resolved [`CompositingSpace`].\n    #[inline]\n    pub fn from_compositing_space(space: Option<CompositingSpace>) -> Self {\n        match space {\n            Some(CompositingSpace::Srgb) => Self::SRGB_COMPOSITING,\n            Some(CompositingSpace::Oklab) => Self::OKLAB_COMPOSITING,","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/bevyengine/bevy/blob/221e52ae323febfd399bd7d067918fc43648cfb3/crates/bevy_sprite_render/src/render/mod.rs#L127-L163","documentation":"SpritePipelineKey::from_target_format (sprite render/mod.rs:141-148) encodes the view's color target format into a 5-bit pipeline-key field via bevy_render::view::texture_format_to_code and expects Some. The code table only covers WebGPU renderable and blendable formats; any other texture format as a sprite camera's render target panics with this message.","triggerScenarios":"A 2D camera rendering sprites into an Image target whose format is unsupported: integer formats (Rgba8Uint/Rgba32Uint), Rgb9e5Ufloat, compressed formats, or any non-blendable variant.","commonSituations":"UI/sprite compositing into custom picking or readback textures; post-process intermediate targets with exotic formats; formats copied from non-rendering examples (storage textures) into camera targets.","solutions":["Switch the target Image to a supported blendable format (Rgba8UnormSrgb, Bgra8UnormSrgb, Rgba16Float, Rgba32Float, Rg11b10Ufloat, ...)","Insert a conversion pass: render sprites to a standard-format target, then copy/convert into the special-format texture","Validate the format with texture_format_to_code before configuring the camera"],"exampleFix":"// before — sprite camera renders into a uint picking texture\nlet target = Image::new_fill(size, Extent3d::default(), &[0; 4], TextureFormat::Rgba8Uint, RenderAssetUsages::RENDER_WORLD);\ncamera.target = target.clone().into();\n\n// after — sprites render to a blendable target; a later pass encodes IDs\nlet target = Image::new_fill(size, Extent3d::default(), &[0; 4], TextureFormat::Rgba8UnormSrgb, RenderAssetUsages::RENDER_WORLD);","handlingStrategy":"validation","validationCode":"use bevy_render::view::texture_format_to_code;\n\nassert!(\n    texture_format_to_code(image.texture_descriptor().format).is_some(),\n    \"format {:?} cannot back a sprite camera target\",\n    image.texture_descriptor().format\n);","typeGuard":"fn is_sprite_target_format(format: TextureFormat) -> bool {\n    bevy_render::view::texture_format_to_code(format).is_some()\n}","tryCatchPattern":null,"preventionTips":["When creating render-target Images programmatically, default to Rgba8UnormSrgb unless HDR is required","Add a debug assert in camera setup code that validates the chosen target format against the supported table"],"tags":["bevy","render-target","texture-format","sprites","pipeline-key","panic"],"backgroundTag":"unsupported-texture-format","analyzedSha":"221e52ae323febfd399bd7d067918fc43648cfb3","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}