Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
2b91bc9
NativeDawn
CedricGuillemet Jul 16, 2026
f01c83e
fix cmake script
CedricGuillemet Jul 16, 2026
c5db0cb
submodules recurse init
CedricGuillemet Jul 16, 2026
5780773
fix ubuntu
CedricGuillemet Jul 16, 2026
9f12ae3
dawn desktop gl off
CedricGuillemet Jul 17, 2026
4d23ee0
more generic dawn plugin
CedricGuillemet Jul 17, 2026
c35a939
bootstrap
CedricGuillemet Jul 17, 2026
c431bf7
fix pg cmake
CedricGuillemet Jul 17, 2026
5b12b9d
iteration
CedricGuillemet Jul 17, 2026
da4388a
vis tests
CedricGuillemet Jul 17, 2026
295f7a0
fixes for 15scenes
CedricGuillemet Jul 17, 2026
1e12267
bundles rendering
CedricGuillemet Jul 21, 2026
ef841d6
blob decoder
CedricGuillemet Jul 23, 2026
286faaf
more tests
CedricGuillemet Jul 24, 2026
d091581
exclusion apis
CedricGuillemet Jul 24, 2026
bd5ea89
fix PG pollution
CedricGuillemet Jul 24, 2026
84cda40
tests
CedricGuillemet Jul 24, 2026
a61358e
more fixes
CedricGuillemet Jul 24, 2026
8dd981a
up rendercount
CedricGuillemet Jul 27, 2026
025b538
disable test
CedricGuillemet Jul 27, 2026
838fa2b
warp tests
CedricGuillemet Jul 27, 2026
f22f7cf
CI: NativeDawn-only + Babylon-Lite scene1 bundle smoke test
CedricGuillemet Jul 28, 2026
5061e1b
NativeDawn: broaden software-adapter detection for WARP MSAA workaround
CedricGuillemet Jul 28, 2026
f3cbc11
config: exclude 'FrameGraph image processing' on WebGPU (CI WARP MSAA…
CedricGuillemet Jul 28, 2026
2729c00
NativeDawn: drain V8 N-API finalizer queue to stop GPU-resource leak
CedricGuillemet Jul 28, 2026
32761cf
[TEMP] CI: isolation-run representative NativeDawn failures for diagn…
CedricGuillemet Jul 28, 2026
f459eda
NativeDawn: port to the WebGPU C API (#11)
bkaradzic-microsoft Aug 24, 2026
ff71460
Test NativeDawn render canvas lookup
CedricGuillemet Aug 24, 2026
a3e734b
Restore the JsRuntimeHost pin lost in the master merge (#12)
bkaradzic-microsoft Aug 25, 2026
ddf1d62
Fix NativeDawn render canvas lookup
CedricGuillemet Aug 25, 2026
5e7e7b6
Fix NativeDawn canvas DOM behavior
CedricGuillemet Aug 26, 2026
aee3e03
Re-enable full CI matrix
CedricGuillemet Aug 26, 2026
7bfe7d2
Restore NativeDawn validation and unit tests
CedricGuillemet Aug 26, 2026
8124e26
Fix UWP diagnostics and Linux line validation
CedricGuillemet Aug 26, 2026
e3f579f
Allow deterministic line raster differences
CedricGuillemet Aug 26, 2026
f620421
Validate NativeDawn across CI adapters
CedricGuillemet Aug 26, 2026
cbb2f4e
Remove superseded NativeDawn shims and isolate Playground host policy
CedricGuillemet Oct 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions .github/scripts/bundle-lite-scene.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
// Bundle a single Babylon-Lite lab scene into one self-contained IIFE "classic"
// script that a standalone V8 JS engine (the BabylonNative Playground on the
// NativeDawn/WebGPU backend) can load with a plain XHR + eval -- no bundler, no
// HTTP server, no ESM/code-splitting.
//
// The official Babylon-Lite build (`pnpm build:bundle-scenes`) emits ESM with
// code-splitting, which the Playground's classic loader can't consume. This
// script re-bundles the same scene entry (e.g. lab/lite/src/lite/scene1.ts)
// against the prebuilt library (packages/babylon-lite/build/lib) as a single
// minified IIFE, inlining every dynamic import.
//
// Prerequisites (run in the Babylon-Lite clone first):
// pnpm install
// pnpm build:lib # produces packages/babylon-lite/build/lib
//
// Usage (cwd = Babylon-Lite clone, so `esbuild` resolves from its node_modules):
// pnpm exec node <path>/bundle-lite-scene.mjs <cloneDir> <scene> <outFile>
// e.g. pnpm exec node .../bundle-lite-scene.mjs . scene1 ./scene1.playground.js
import { resolve } from "node:path";
import { existsSync } from "node:fs";
import { createRequire } from "node:module";
import { pathToFileURL } from "node:url";

const cloneDir = resolve(process.argv[2] || process.cwd());
const scene = process.argv[3] || "scene1";
const outFile = resolve(process.argv[4] || resolve(cloneDir, `${scene}.playground.js`));

// Resolve esbuild from the Babylon-Lite clone's node_modules (this script lives
// in the BabylonNative repo, so a bare `import "esbuild"` would resolve against
// the wrong tree). Babylon-Lite already declares esbuild as a direct dependency.
const requireFromClone = createRequire(resolve(cloneDir, "package.json"));
const esbuildEntry = requireFromClone.resolve("esbuild");
const { build } = await import(pathToFileURL(esbuildEntry));

const entryCandidates = [
resolve(cloneDir, `lab/lite/src/lite/${scene}.ts`),
resolve(cloneDir, `lab/src/lite/${scene}.ts`),
];
const entry = entryCandidates.find(existsSync);
if (!entry) {
console.error("[bundle-lite-scene] scene entry not found. Tried:\n " + entryCandidates.join("\n "));
process.exit(1);
}

const libDir = resolve(cloneDir, "packages/babylon-lite/build/lib");
if (!existsSync(libDir)) {
console.error("[bundle-lite-scene] prebuilt lib missing: " + libDir + "\n Run `pnpm build:lib` first.");
process.exit(1);
}

console.log("[bundle-lite-scene] entry : " + entry);
console.log("[bundle-lite-scene] lib : " + libDir);
console.log("[bundle-lite-scene] out : " + outFile);

try {
await build({
entryPoints: [entry],
bundle: true,
splitting: false, // single file: inline all dynamic imports
format: "iife", // classic script (no import/export)
platform: "browser",
target: "esnext",
minify: true,
keepNames: true, // Babylon-Lite relies on Function.name
legalComments: "none",
sourcemap: false,
outfile: outFile,
alias: { "babylon-lite": libDir },
loader: { ".wgsl": "text", ".glsl": "text" },
logLevel: "info",
});
console.log("[bundle-lite-scene] wrote " + outFile);
} catch (err) {
console.error("[bundle-lite-scene] build failed:", err);
process.exit(1);
}
21 changes: 21 additions & 0 deletions .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
js-engine:
required: true
type: string
nativedawn:
required: false
type: boolean
default: false

env:
NDK_VERSION: '28.2.13676358'
Expand Down Expand Up @@ -40,6 +44,7 @@ jobs:
fi

- name: Build Playground ${{ inputs.js-engine }}
if: ${{ !inputs.nativedawn }}
working-directory: Apps/Playground/Android
run: |
chmod +x gradlew
Expand All @@ -50,3 +55,19 @@ jobs:
-PBABYLON_NATIVE_PLUGIN_NATIVEDRACO=ON \
-PBABYLON_NATIVE_PLUGIN_NATIVEMESHOPT=ON \
-PSANITIZERS=OFF

# NativeDawn (WebGPU/Dawn, Vulkan backend) build. The Android app native
# lib has no Dawn code path, so build only the NativeDawn plugin target (via the -PNativeDawn
# gradle property, which also restricts the CMake `targets`) to validate it
# compiles/links; the full APK is not assembled.
- name: Build NativeDawn ${{ inputs.js-engine }}
if: ${{ inputs.nativedawn }}
working-directory: Apps/Playground/Android
run: |
chmod +x gradlew
./gradlew :BabylonNative:externalNativeBuildRelease \
-PJSEngine=${{ inputs.js-engine }} \
-PARM64Only \
-PNDK_VERSION=${{ env.NDK_VERSION }} \
-PSANITIZERS=OFF \
-PNativeDawn=ON
29 changes: 29 additions & 0 deletions .github/workflows/build-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ on:
required: false
type: string
default: macos-latest
nativedawn:
required: false
type: boolean
default: false

# Absorb transient npm registry / CDN flakes during `npm install` in Apps/CMakeLists.txt.
# npm's default fetch-retries is 2; bump to 5 (npm's own exponential backoff handles spacing).
Expand All @@ -32,6 +36,7 @@ jobs:
run: sudo xcode-select --switch /Applications/Xcode_${{ inputs.xcode-version }}.app/Contents/Developer

- name: Generate iOS solution
if: ${{ !inputs.nativedawn }}
run: |
cmake -G Xcode -B build/iOS \
-D IOS=ON \
Expand All @@ -42,10 +47,34 @@ jobs:
-D CMAKE_IOS_INSTALL_COMBINED=NO

- name: Build Playground iOS
if: ${{ !inputs.nativedawn }}
run: |
xcodebuild \
-project build/iOS/BabylonNative.xcodeproj \
-scheme Playground \
-sdk iphoneos \
-configuration Release \
CODE_SIGNING_ALLOWED=NO

# NativeDawn (WebGPU/Dawn, Metal backend) build. The iOS Playground host
# has no Dawn code path, so build the NativeDawn plugin target (plugin + Dawn) to validate it
# compiles/links.
- name: Generate iOS solution (NativeDawn)
if: ${{ inputs.nativedawn }}
run: |
cmake -G Xcode -B build/iOS \
-D IOS=ON \
-D DEPLOYMENT_TARGET=${{ inputs.deployment-target }} \
-D BABYLON_DEBUG_TRACE=ON \
-D CMAKE_IOS_INSTALL_COMBINED=NO \
-D BABYLON_NATIVE_PLUGIN_NATIVEDAWN=ON

- name: Build NativeDawn iOS
if: ${{ inputs.nativedawn }}
run: |
xcodebuild \
-project build/iOS/BabylonNative.xcodeproj \
-scheme NativeDawn \
-sdk iphoneos \
-configuration Release \
CODE_SIGNING_ALLOWED=NO
47 changes: 36 additions & 11 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
required: false
type: boolean
default: false
nativedawn:
required: false
type: boolean
default: false

env:
UBSAN_OPTIONS: halt_on_error=1:print_stacktrace=1:symbolize=1
Expand All @@ -42,11 +46,15 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y libjavascriptcoregtk-4.1-dev libgl1-mesa-dev libcurl4-openssl-dev libwayland-dev clang ninja-build
if [ "${{ inputs.graphics-api }}" = "Vulkan" ]; then
if [ "${{ inputs.graphics-api }}" = "Vulkan" ] || [ "${{ inputs.nativedawn }}" = "true" ]; then
sudo apt-get install -y libvulkan-dev mesa-vulkan-drivers xvfb xauth
fi
if [ "${{ inputs.nativedawn }}" = "true" ]; then
sudo apt-get install -y libx11-xcb-dev
fi

- name: Build X11
if: ${{ !inputs.nativedawn }}
run: |
cmake -G Ninja -B build/Linux \
-D JAVASCRIPTCORE_LIBRARY=/usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-4.1.so \
Expand All @@ -62,7 +70,23 @@ jobs:
-D ENABLE_SANITIZERS=${{ inputs.enable-sanitizers && 'ON' || 'OFF' }} .
ninja -C build/Linux

# The Linux Playground host has no Dawn code path, so compile and link
# the plugin target directly.
- name: Build NativeDawn
if: ${{ inputs.nativedawn }}
run: |
cmake -G Ninja -B build/Linux \
-D JAVASCRIPTCORE_LIBRARY=/usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-4.1.so \
-D NAPI_JAVASCRIPT_ENGINE=${{ inputs.js-engine }} \
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
-D BX_CONFIG_DEBUG=ON \
-D OpenGL_GL_PREFERENCE=GLVND \
-D BABYLON_DEBUG_TRACE=ON \
-D BABYLON_NATIVE_PLUGIN_NATIVEDAWN=ON .
ninja -C build/Linux NativeDawn

- name: Enable Core Dump
if: ${{ !inputs.nativedawn }}
run: sudo sysctl -w kernel.core_pattern=core.%p

- name: Select Vulkan software renderer
Expand All @@ -73,7 +97,7 @@ jobs:
echo "VK_ICD_FILENAMES=$VK_ICD_FILENAMES" >> "$GITHUB_ENV"

- name: Validation Tests
if: ${{ inputs.graphics-api != 'Vulkan' }}
if: ${{ !inputs.nativedawn && inputs.graphics-api != 'Vulkan' }}
run: |
cd build/Linux/Apps/Playground
ulimit -c unlimited
Expand All @@ -82,7 +106,7 @@ jobs:
# The full Vulkan suite currently has broad reference-image differences and
# crashes in Glow layer and LODs: https://github.com/BabylonJS/BabylonNative/issues/1878
- name: Vulkan Validation Tests
if: ${{ inputs.graphics-api == 'Vulkan' }}
if: ${{ !inputs.nativedawn && inputs.graphics-api == 'Vulkan' }}
timeout-minutes: 5
run: |
cd build/Linux/Apps/Playground
Expand All @@ -100,6 +124,7 @@ jobs:
grep -Fx 'Run complete. ran=2 passed=2 failed=0 missingRef=0 skipped=0' vulkan-validation.log

- name: Unit Tests
if: ${{ !inputs.nativedawn }}
run: |
cd build/Linux/Apps/UnitTests
ulimit -c unlimited
Expand All @@ -114,7 +139,7 @@ jobs:
fi

- name: Verify Vulkan Unit Test Results
if: ${{ inputs.graphics-api == 'Vulkan' }}
if: ${{ !inputs.nativedawn && inputs.graphics-api == 'Vulkan' }}
run: |
cd build/Linux/Apps/UnitTests
# Require both boundary tests, independent of unrelated additions to the suite.
Expand All @@ -137,40 +162,40 @@ jobs:
PY

- name: Module Load Test
if: ${{ !inputs.enable-sanitizers }}
if: ${{ !inputs.enable-sanitizers && !inputs.nativedawn }}
run: |
cd build/Linux/Apps/ModuleLoadTest
ulimit -c unlimited
xvfb-run --auto-servernum ./ModuleLoadTest

- name: Upload Vulkan Test Results
if: ${{ always() && inputs.graphics-api == 'Vulkan' }}
if: ${{ always() && !inputs.nativedawn && inputs.graphics-api == 'Vulkan' }}
uses: actions/upload-artifact@v6
with:
name: ${{ inputs.cc }}-${{ inputs.js-engine }}-${{ inputs.graphics-api }}${{ inputs.enable-sanitizers && '-sanitizer' || '' }}-test-results
name: ${{ inputs.cc }}-${{ inputs.js-engine }}-${{ inputs.graphics-api }}${{ inputs.nativedawn && '-nativedawn' || '' }}${{ inputs.enable-sanitizers && '-sanitizer' || '' }}-test-results
path: |
build/Linux/Apps/Playground/vulkan-validation.log
build/Linux/Apps/UnitTests/vulkan-unit-test-results.xml

- name: Upload Rendered Pictures
if: ${{ always() }}
if: ${{ always() && !inputs.nativedawn }}
uses: actions/upload-artifact@v6
with:
name: ${{ inputs.cc }}-${{ inputs.js-engine }}-${{ inputs.graphics-api }}${{ inputs.enable-sanitizers && '-sanitizer' || '' }}-rendered-pictures
name: ${{ inputs.cc }}-${{ inputs.js-engine }}-${{ inputs.graphics-api }}${{ inputs.nativedawn && '-nativedawn' || '' }}${{ inputs.enable-sanitizers && '-sanitizer' || '' }}-rendered-pictures
path: build/Linux/Apps/Playground/Results

- name: Upload Error Pictures
if: ${{ failure() }}
uses: actions/upload-artifact@v6
with:
name: ${{ inputs.cc }}-${{ inputs.js-engine }}-${{ inputs.graphics-api }}${{ inputs.enable-sanitizers && '-sanitizer' || '' }}-error-pictures
name: ${{ inputs.cc }}-${{ inputs.js-engine }}-${{ inputs.graphics-api }}${{ inputs.nativedawn && '-nativedawn' || '' }}${{ inputs.enable-sanitizers && '-sanitizer' || '' }}-error-pictures
path: build/Linux/Apps/Playground/Errors

- name: Upload Core Dumps
if: ${{ failure() }}
uses: actions/upload-artifact@v6
with:
name: ${{ inputs.cc }}-${{ inputs.js-engine }}-${{ inputs.graphics-api }}${{ inputs.enable-sanitizers && '-sanitizer' || '' }}-core-dumps
name: ${{ inputs.cc }}-${{ inputs.js-engine }}-${{ inputs.graphics-api }}${{ inputs.nativedawn && '-nativedawn' || '' }}${{ inputs.enable-sanitizers && '-sanitizer' || '' }}-core-dumps
path: |
build/Linux/Apps/Playground/Playground
build/Linux/Apps/Playground/core.*
Expand Down
23 changes: 22 additions & 1 deletion .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ on:
required: false
type: string
default: ''
nativedawn:
required: false
type: boolean
default: false

env:
UBSAN_OPTIONS: halt_on_error=1:print_stacktrace=1:symbolize=1
Expand All @@ -43,6 +47,7 @@ jobs:
run: sudo xcode-select --switch /Applications/Xcode_${{ inputs.xcode-version }}.app/Contents/Developer

- name: Generate macOS solution
if: ${{ !inputs.nativedawn }}
run: |
cmake -G "${{ inputs.generator }}" -B build/macOS \
${{ inputs.js-engine != '' && format('-D NAPI_JAVASCRIPT_ENGINE={0}', inputs.js-engine) || '' }} \
Expand All @@ -53,25 +58,41 @@ jobs:
-D BABYLON_NATIVE_TESTS_USE_NOOP_METAL_DEVICE=ON

- name: Build Playground macOS
if: ${{ !inputs.nativedawn }}
run: cmake --build build/macOS --target Playground --config RelWithDebInfo

- name: Build UnitTests macOS
if: ${{ !inputs.nativedawn }}
run: cmake --build build/macOS --target UnitTests --config RelWithDebInfo

- name: Build ModuleLoadTest macOS
if: ${{ !inputs.nativedawn }}
run: cmake --build build/macOS --target ModuleLoadTest --config RelWithDebInfo

# NativeDawn (WebGPU/Dawn, Metal backend) build. The macOS Playground host
# has no Dawn code path, so build the NativeDawn plugin target (plugin + Dawn) to validate it
# compiles/links; the bgfx unit tests don't apply.
- name: Build NativeDawn macOS
if: ${{ inputs.nativedawn }}
run: |
cmake -G "${{ inputs.generator }}" -B build/macOS \
-D BABYLON_DEBUG_TRACE=ON \
-D BABYLON_NATIVE_PLUGIN_NATIVEDAWN=ON
cmake --build build/macOS --target NativeDawn --config RelWithDebInfo

- name: Enable Core Dump
if: ${{ !inputs.nativedawn }}
run: sudo sysctl -w kern.corefile=%N.core.%P

- name: Run UnitTests macOS
if: ${{ !inputs.nativedawn }}
run: |
cd build/macOS/Apps/UnitTests/RelWithDebInfo
ulimit -c unlimited
./UnitTests

- name: Run ModuleLoadTest macOS
if: ${{ !inputs.enable-sanitizers }}
if: ${{ !inputs.enable-sanitizers && !inputs.nativedawn }}
run: |
cd build/macOS/Apps/ModuleLoadTest/RelWithDebInfo
ulimit -c unlimited
Expand Down
Loading
Loading