Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
a2c0206
NativeDawn
CedricGuillemet Jul 16, 2026
2015cf7
fix cmake script
CedricGuillemet Jul 16, 2026
703e9b5
submodules recurse init
CedricGuillemet Jul 16, 2026
6b6b0c6
fix ubuntu
CedricGuillemet Jul 16, 2026
ef5e4b0
dawn desktop gl off
CedricGuillemet Jul 17, 2026
8fb57a6
more generic dawn plugin
CedricGuillemet Jul 17, 2026
a760f91
bootstrap
CedricGuillemet Jul 17, 2026
442264e
fix pg cmake
CedricGuillemet Jul 17, 2026
a527cfb
iteration
CedricGuillemet Jul 17, 2026
8310553
vis tests
CedricGuillemet Jul 17, 2026
f69dd59
fixes for 15scenes
CedricGuillemet Jul 17, 2026
3c12004
bundles rendering
CedricGuillemet Jul 21, 2026
8160bf1
blob decoder
CedricGuillemet Jul 23, 2026
38e02af
more tests
CedricGuillemet Jul 24, 2026
d8a59c6
Merge remote-tracking branch 'origin/master' into nativeDawn
CedricGuillemet Jul 24, 2026
5e40810
exclusion apis
CedricGuillemet Jul 24, 2026
d597ea5
fix PG pollution
CedricGuillemet Jul 24, 2026
ff81f94
tests
CedricGuillemet Jul 24, 2026
abcfa98
more fixes
CedricGuillemet Jul 24, 2026
282f808
up rendercount
CedricGuillemet Jul 27, 2026
54d4e86
disable test
CedricGuillemet Jul 27, 2026
c4eda40
warp tests
CedricGuillemet Jul 27, 2026
a89d5d7
CI: NativeDawn-only + Babylon-Lite scene1 bundle smoke test
CedricGuillemet Jul 28, 2026
dad6730
NativeDawn: broaden software-adapter detection for WARP MSAA workaround
CedricGuillemet Jul 28, 2026
5ba3840
config: exclude 'FrameGraph image processing' on WebGPU (CI WARP MSAA…
CedricGuillemet Jul 28, 2026
a7edc0c
validation_native: temporary continue-on-failure enumeration pass
CedricGuillemet Jul 28, 2026
a9f7a60
NativeDawn: drain V8 N-API finalizer queue to stop GPU-resource leak
CedricGuillemet Jul 28, 2026
8c658f8
[TEMP] CI: isolation-run representative NativeDawn failures for diagn…
CedricGuillemet Jul 28, 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
77 changes: 77 additions & 0 deletions .github/scripts/bundle-lite-scene.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
// 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
// pnpm add -D -w esbuild # make esbuild resolvable
//
// 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). `pnpm add -D -w esbuild` in the clone makes it a direct dep.
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);
}
22 changes: 22 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 @@ -48,3 +53,20 @@ jobs:
-PARM64Only \
-PNDK_VERSION=${{ env.NDK_VERSION }} \
-PSANITIZERS=OFF

# NativeDawn (WebGPU/Dawn, Vulkan backend) build: enabling the plugin
# force-disables NativeEngine. 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
30 changes: 30 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 @@ -40,10 +45,35 @@ 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: enabling the plugin
# force-disables NativeEngine. 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
33 changes: 31 additions & 2 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,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 @@ -40,7 +44,12 @@ jobs:
sudo apt-get update
sudo apt-get install -y libjavascriptcoregtk-4.1-dev libgl1-mesa-dev libcurl4-openssl-dev libwayland-dev clang ninja-build

- name: Install Vulkan packages (NativeDawn)
if: ${{ inputs.nativedawn }}
run: sudo apt-get install -y libvulkan-dev libx11-xcb-dev

- 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 @@ -53,30 +62,50 @@ jobs:
-D ENABLE_SANITIZERS=${{ inputs.enable-sanitizers && 'ON' || 'OFF' }} .
ninja -C build/Linux

# NativeDawn (WebGPU/Dawn, Vulkan backend) build: enabling the plugin
# force-disables NativeEngine. The Linux Playground host has no Dawn code
# path, so build the NativeDawn plugin target (plugin + Dawn) to validate it
# compiles/links; the bgfx validation/unit tests don't apply.
- 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: Validation Tests
if: ${{ !inputs.nativedawn }}
run: |
cd build/Linux/Apps/Playground
ulimit -c unlimited
xvfb-run ./Playground app:///Scripts/validation_native.js

- name: Unit Tests
if: ${{ !inputs.nativedawn }}
run: |
cd build/Linux/Apps/UnitTests
ulimit -c unlimited
xvfb-run ./UnitTests

- 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 ./ModuleLoadTest

- name: Upload Rendered Pictures
if: always()
if: ${{ always() && !inputs.nativedawn }}
uses: actions/upload-artifact@v6
with:
name: ${{ inputs.cc }}-${{ inputs.js-engine }}${{ inputs.enable-sanitizers && '-sanitizer' || '' }}-rendered-pictures
Expand Down
24 changes: 23 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 @@ -51,25 +56,42 @@ 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: enabling the plugin
# force-disables NativeEngine. 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