diff --git a/Cargo.toml b/Cargo.toml index 10bd1c431e1cc..2cc66e61449f6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -132,6 +132,9 @@ jpeg = ["bevy_internal/jpeg"] # BMP image format support bmp = ["bevy_internal/bmp"] +# WebP image format support +webp = ["bevy_internal/webp"] + # Basis Universal compressed texture support basis-universal = ["bevy_internal/basis-universal"] diff --git a/crates/bevy_internal/Cargo.toml b/crates/bevy_internal/Cargo.toml index 8ad1c1a14fd08..75b30067a7728 100644 --- a/crates/bevy_internal/Cargo.toml +++ b/crates/bevy_internal/Cargo.toml @@ -32,6 +32,7 @@ png = ["bevy_render/png"] tga = ["bevy_render/tga"] jpeg = ["bevy_render/jpeg"] bmp = ["bevy_render/bmp"] +webp = ["bevy_render/webp"] basis-universal = ["bevy_render/basis-universal"] dds = ["bevy_render/dds"] ktx2 = ["bevy_render/ktx2"] diff --git a/crates/bevy_render/Cargo.toml b/crates/bevy_render/Cargo.toml index a42ef073b6231..e10f7f6da5841 100644 --- a/crates/bevy_render/Cargo.toml +++ b/crates/bevy_render/Cargo.toml @@ -15,6 +15,7 @@ hdr = ["image/hdr"] tga = ["image/tga"] jpeg = ["image/jpeg"] bmp = ["image/bmp"] +webp = ["image/webp"] dds = ["ddsfile"] # For ktx2 supercompression diff --git a/crates/bevy_render/src/texture/image_texture_loader.rs b/crates/bevy_render/src/texture/image_texture_loader.rs index 791161411506c..577f83626853f 100644 --- a/crates/bevy_render/src/texture/image_texture_loader.rs +++ b/crates/bevy_render/src/texture/image_texture_loader.rs @@ -34,6 +34,8 @@ const FILE_EXTENSIONS: &[&str] = &[ "jpeg", #[cfg(feature = "ktx2")] "ktx2", + #[cfg(feature = "webp")] + "webp", ]; impl AssetLoader for ImageTextureLoader { diff --git a/docs/cargo_features.md b/docs/cargo_features.md index aac27b3185381..af8961ffd68c8 100644 --- a/docs/cargo_features.md +++ b/docs/cargo_features.md @@ -68,5 +68,6 @@ The default feature set enables most of the expected features of a game engine, |trace_tracy|Tracing support, exposing a port for Tracy| |wav|WAV audio format support| |wayland|Wayland display server support| +|webp|WebP image format support| |wgpu_trace|Save a trace of all wgpu calls| |zlib|For KTX2 supercompression|