Skip to content

Consolidate polyfill options and fix Embedding installation and WebP decoding - #1903

Merged
bghgary merged 31 commits into
BabylonJS:masterfrom
bghgary:bghgary-consolidate-polyfill-flags
Oct 2, 2026
Merged

bghgary merged 31 commits into
BabylonJS:masterfrom
bghgary:bghgary-consolidate-polyfill-flags

Conversation

@bghgary

@bghgary bghgary commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

[Created by Copilot on behalf of @bghgary]

Context

Babylon Native exposed duplicate switches for four polyfills supplied by JsRuntimeHost. Disabling one upstream could leave Embedding or Window referencing an unavailable library. JsRuntimeHost now controls AbortController, Scheduling, URL, and WebSocket.

Installed Embedding packages omitted dependencies needed by consumers, causing link failures.

NativeEngine's separate WebP switch could override bimg's parser settings.

Windows Imaging Component decoding is enabled by default on Windows. The 16-bit PNG tests allow a one-level difference when reducing channels to 8-bit; 8-bit images and channel endpoints remain exact.

AbortController, Scheduling, URL, and WebSocket were controlled by
separate Babylon Native options even though JsRuntimeHost owns their
targets. Removing a target in JsRuntimeHost left Embedding and Window
referencing unavailable headers and libraries.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 29, 2026 19:45

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.

Copilot review overview

🟢 Approval recommended

The CMake target checks, compile definitions, source guards, and documentation consistently implement the intended option ownership.

Review effort: Balanced
Findings: None

What changed in this PR

Aligns Embedding polyfill initialization with JsRuntimeHost options while allowing Window to build without Scheduling.

Changes:

  • Gates four polyfills using JsRuntimeHost-generated targets.
  • Makes Window’s Scheduling dependency optional.
  • Removes obsolete Babylon Native options and documents replacements.
File Description
CMakeLists.txt Removes superseded polyfill options.
Documentation/​Polyfills.md Documents JsRuntimeHost configuration.
Embedding/​CMakeLists.txt Conditionally links available polyfill targets.
Embedding/​Source/​Runtime.cpp Conditionally includes and initializes polyfills.
Polyfills/​Window/​CMakeLists.txt Makes Scheduling linkage optional.
Polyfills/​Window/​Source/​Window.cpp Gates Scheduling integration.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

bghgary and others added 6 commits September 29, 2026 15:11
Pin the revision that exposes the new spelling and use it to guard Embedding compilation and initialization.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Set bimg's WebP macro explicitly for active NativeEngine image loading, while keeping the existing off and disabled-engine behavior. Add a focused compile-definition regression fixture and document the option interaction.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The production decoder was verified with real WebP input under generic parser-off settings, both with WebP enabled and disabled.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Remove the WebP option explanation and historical polyfill-switch notes after review.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Embedding build settings belong with Embedding documentation; avoid adding a new document before its location is agreed.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@bghgary bghgary changed the title Use JsRuntimeHost options for Embedding polyfills Consolidate polyfill options and fix Embedding installation and WebP decoding Sep 29, 2026
bghgary and others added 2 commits September 29, 2026 16:31
Default generic parsing off and enable the eight image formats used by native image loading. Forward each format option directly to bimg_decode instead of tying WebP parsing to NativeEngine image loading.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep bgfx.cmake as owner of the generic parser switch while defaulting it off for Babylon Native. Compile only selected bundled parsers, validate format names, and reject stb combinations unsupported by the pinned bimg decoder.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
bghgary added a commit that referenced this pull request Sep 30, 2026
[Created by Copilot on behalf of @bghgary]

## Context

Mesa 25.2.8-0ubuntu0.24.04.3 makes its EGL library load
`libwayland-server.so.0`. The Linux module-load test rejects that
graphics dependency, blocking otherwise unrelated pull requests such as
#1903 and #1905. This accepts that dependency while continuing to reject
other unexpected modules.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
bghgary and others added 3 commits September 30, 2026 13:39
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The updated wrapper forwards per-format settings and pins the bimg allocator fix, allowing JPEG without PNG. Preserve explicit overrides while passing selected defaults before dependency configuration.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@bghgary
bghgary marked this pull request as draft September 30, 2026 21:29
bghgary and others added 10 commits September 30, 2026 14:40
Use the fork until the dependency changes land upstream.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Supply normal defaults for unselected formats as well as selected formats so dependency options do not cache implicit choices. Explicit consumer overrides remain untouched.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The WIC decoder contract remains pending upstream; keep the consumer PR draft until runtime behavior can be verified.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The combined wrapper preserves the landed bgfx and bx revisions alongside per-format parser configuration.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@bghgary
bghgary marked this pull request as ready for review October 1, 2026 16:39
bghgary and others added 6 commits October 1, 2026 09:54
Remove the redundant Babylon Native format list and adapter defaults so upstream parser settings remain authoritative.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Default PIC, PNM and PSD parsing to OFF without replacing explicit cache or parent settings. Keep empty values inheriting the generic upstream parser switch.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Construct Runtime in a separate installed-library consumer instead of checking three dependency files. The link check exposes missing installed dependencies, including the optional TestUtils archive.

Keep Scheduling required by Window and reject incompatible configuration before compilation. Embedding remains usable with both Window and Scheduling disabled.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use normal OFF variables for PIC, PNM and PSD so Babylon Native excludes them even when upstream cache or parent settings request them.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
bghgary and others added 3 commits October 1, 2026 17:25
Retain the landed bgfx.cmake revision 8edfdc308848df5bb86fc1af0228080deda0045b and existing parser restrictions. WIC remains disabled by bimg default; its format selection follows the individual PNG, JPEG, BMP and GIF controls.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Pin the merged bgfx.cmake option that forwards BIMG_CONFIG_USE_WIC with its upstream OFF default. Document direct Windows usage without adding a Babylon Native switch.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Respect explicit decoder selections. Allow one-level rounding differences
when 16-bit PNG samples are converted to 8-bit, retaining exact endpoint
and 8-bit comparisons.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@bghgary
bghgary enabled auto-merge (squash) October 2, 2026 00:55
@bghgary
bghgary merged commit 5051e98 into BabylonJS:master Oct 2, 2026
35 checks passed
@bghgary
bghgary deleted the bghgary-consolidate-polyfill-flags branch October 2, 2026 03:45
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.

3 participants