bevyengine/bevy · error · HdrTextureLoaderError

Could load texture: {0}

Error message

Could load texture: {0}

What it means

HdrTextureLoaderError::Io: reading the HDR (.hdr/.pic) texture file from the asset source failed; the std::io::Error is forwarded. (Note the message typo 'Could load texture'.)

Source

Thrown at crates/bevy_image/src/hdr_texture_loader.rs:26

use wgpu_types::{Extent3d, TextureDimension, TextureFormat};

/// Loads HDR textures as Texture assets
#[derive(Clone, Default, TypePath)]
pub struct HdrTextureLoader;

/// Settings for [`HdrTextureLoader`].
#[derive(Serialize, Deserialize, Default, Debug)]
pub struct HdrTextureLoaderSettings {
    /// Where the asset will be used - see the docs on [`RenderAssetUsages`] for details.
    pub asset_usage: RenderAssetUsages,
}

/// Possible errors that can be produced by [`HdrTextureLoader`]
#[non_exhaustive]
#[derive(Debug, Error)]
pub enum HdrTextureLoaderError {
    /// I/O Error.
    #[error("Could load texture: {0}")]
    Io(#[from] std::io::Error),
    /// Failed to decode the texture.
    #[error("Could not extract image: {0}")]
    Image(#[from] image::ImageError),
}

impl AssetLoader for HdrTextureLoader {
    type Asset = Image;
    type Settings = HdrTextureLoaderSettings;
    type Error = HdrTextureLoaderError;
    async fn load(
        &self,
        reader: &mut dyn Reader,
        settings: &Self::Settings,
        _load_context: &mut LoadContext<'_>,
    ) -> Result<Image, Self::Error> {
        let format = TextureFormat::Rgba32Float;
        // `Rgba32Float` will always return a valid pixel size

View on GitHub (pinned to 396ca72708)

Solutions

  1. Check the asset path and that the file exists in the asset source
  2. Verify asset reader configuration / hot-reloading issues
  3. Handle the LoadState::Failed result for this asset
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at crates/bevy_image/src/hdr_texture_loader.rs:26 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/574dcb6c5ad210b1. Report an issue: GitHub.