Skip to content

Remove libwebp dependency; rely on bimg for WebP decoding#1740

Open
bkaradzic-microsoft wants to merge 2 commits into
BabylonJS:masterfrom
bkaradzic-microsoft:remove-webp-use-bimg
Open

Remove libwebp dependency; rely on bimg for WebP decoding#1740
bkaradzic-microsoft wants to merge 2 commits into
BabylonJS:masterfrom
bkaradzic-microsoft:remove-webp-use-bimg

Conversation

@bkaradzic-microsoft

Copy link
Copy Markdown
Contributor

What

bimg now parses WebP natively via its bundled simplewebp decoder (BIMG_CONFIG_PARSE_WEBP defaults to on), so the standalone libwebp dependency and the WebP decode fallback in NativeEngine are now redundant. This removes them.

Changes

  • Drop the libwebp FetchContent declaration (root CMakeLists.txt) and its dependency build block (Dependencies/CMakeLists.txt).
  • Remove the BABYLON_NATIVE_PLUGIN_NATIVEENGINE_WEBP option, the WEBP compile definition / webp link in the NativeEngine target, and the libwebp install entry (Install/Install.cmake).
  • Remove the <webp/decode.h> include and the WebPGetInfo / WebPDecodeRGBAInto fallback in ParseImage; bimg::imageParse now handles WebP directly.
  • Drop the libwebp NOTICE.md section.

Verification

  • CMake configures with no libwebp fetch and no dangling target references.
  • Playground builds clean (D3D11).
  • The EXT_texture_webp Playground visual test passes with no pixel difference using bimg's decoder (ran=1 passed=1 failed=0). CI exercises this test on all backends.

Copilot AI review requested due to automatic review settings June 8, 2026 18:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the standalone libwebp dependency and the NativeEngine-side WebP decode fallback, relying instead on bimg’s built-in WebP parsing/decoding to handle WebP images end-to-end.

Changes:

  • Removed libwebp FetchContent/dependency wiring and associated install logic.
  • Deleted the NativeEngine WebP feature toggle/compile definition/link and the WebPDecode* fallback path in ParseImage.
  • Updated third-party notices to drop the libwebp license section.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Plugins/NativeEngine/Source/NativeEngine.cpp Removes webp/decode.h usage and the libwebp-based WebP decoding fallback; bimg::imageParse is now the single image parse path.
Plugins/NativeEngine/CMakeLists.txt Drops the NativeEngine WebP option wiring (WEBP define + webp link).
CMakeLists.txt Removes FetchContent_Declare(libwebp) and eliminates the NativeEngine WebP option/config coupling.
Dependencies/CMakeLists.txt Removes the conditional block that fetched/built libwebp and set its target properties.
Install/Install.cmake Removes installation of the webp target when present.
NOTICE.md Removes the libwebp notice section.

bkaradzic-microsoft and others added 2 commits June 9, 2026 09:25
bimg now parses WebP natively via its bundled simplewebp decoder
(BIMG_CONFIG_PARSE_WEBP defaults on), so the standalone libwebp
dependency and the WebP decode fallback in NativeEngine are redundant.

- Drop the libwebp FetchContent declaration and its dependency build block.
- Remove the BABYLON_NATIVE_PLUGIN_NATIVEENGINE_WEBP option, the WEBP
  compile definition / webp link in the NativeEngine target, and the
  libwebp install entry.
- Remove the <webp/decode.h> include and the WebPGetInfo/WebPDecodeRGBAInto
  fallback in ParseImage; bimg::imageParse now handles WebP directly.
- Drop the libwebp NOTICE section.

Verified: the EXT_texture_webp Playground visual test passes with no pixel
difference using bimg's decoder.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Restore the BABYLON_NATIVE_PLUGIN_NATIVEENGINE_WEBP option (and its
coupling to LOAD_IMAGES) so WebP support stays toggleable. Instead of the
removed libwebp path, disabling the option now compiles WebP parsing out
of bimg by defining BIMG_CONFIG_PARSE_WEBP=0 on the bimg_decode target.
Default (ON) leaves bimg's bundled simplewebp decoder enabled.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants