Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
c788224
Clean generated artifacts and tighten WebGPU canvas/runtime hot paths
matthargett Feb 9, 2026
8b2f22c
Probe upstream wgpu-native adapter/device bootstrap via C ABI
matthargett Feb 9, 2026
e605e20
Avoid wgpu-native waitAny panic by pumping processEvents
matthargett Feb 9, 2026
1c90e72
Update migration notes for processEvents-based upstream probe
matthargett Feb 9, 2026
46448f3
Stabilize CanvasWgpu lifecycle and prep upstream wgpu-native migration
matthargett Feb 9, 2026
007e6b0
Reduce NativeWebGPU hot-path JS callback churn
matthargett Feb 9, 2026
df2a80f
Cut hot-loop allocations in Canvas and compute paths
matthargett Feb 9, 2026
05d7f93
Gate local compute cache behind non-upstream feature
matthargett Feb 9, 2026
96caa9b
Cache upstream wgpu-native compute runtime
matthargett Feb 9, 2026
474adee
Extract upstream wgpu-native bindings into shim crate
matthargett Feb 9, 2026
13f4b5c
Reuse upstream bootstrap runtime in create path
matthargett Feb 9, 2026
341680d
Align local backend with wgpu 27 and slim shim wiring
matthargett Feb 9, 2026
b97e446
Reuse native debug texture buffers to remove hot-loop allocations
matthargett Feb 9, 2026
403e9fb
Add upstream surface-backed adapter probing in shim
matthargett Feb 9, 2026
7bb59d6
Probe upstream surface configure/present path in shim
matthargett Feb 9, 2026
3dbe946
Consolidate Rust crates and split lib.rs into modules
matthargett Feb 16, 2026
0afe0a3
Update CMake build system for consolidated Rust workspace
matthargett Feb 16, 2026
6011d46
Harden CanvasWgpu fidelity and eliminate hot-path copies
matthargett Feb 16, 2026
9cb2afc
Align NativeWebGPU with W3C spec and optimize hot path
matthargett Feb 16, 2026
fac6aa6
Overhaul Playground scripts and platform bridges for WebGPU
matthargett Feb 16, 2026
0b18375
Add CI workflows, NOTICE, and update migration plan
matthargett Feb 16, 2026
48f6a41
Fix MSVC portability issues in CanvasWgpu headers
matthargett Feb 16, 2026
e81c530
Merge origin/master: integrate refactored plugins, disable bgfx-depen…
matthargett Feb 17, 2026
4941d4e
Fix MSVC CI build failures and address PR review comments
matthargett Feb 17, 2026
1c23114
Fix Ubuntu CI: suppress unused instance warning and add libvulkan-dev
matthargett Feb 17, 2026
134f0ca
Fix Win32 MSVC and Android CI failures
matthargett Feb 18, 2026
1ce7ac1
Fix MSVC tolower truncation warning and Android bindgen sysroot
matthargett Feb 18, 2026
9102cd1
Suppress MSVC warnings in CanvasWgpu napi callbacks
matthargett Feb 18, 2026
a78e792
Fix std::tolower C4244 in LineCaps.h
matthargett Feb 18, 2026
be8314b
Add comments explaining tolower loop and unsigned char cast
matthargett Feb 20, 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
19 changes: 19 additions & 0 deletions .github/jobs/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,22 @@ steps:
choco install cmake --version=$(CMAKE_VERSION) -y --allow-downgrade
condition: contains('${{parameters.vmImage}}', 'windows')
displayName: "CMake version"

# Rust toolchain -- required by the wgpu backend build.
- script: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
echo "##vso[task.prependpath]$HOME/.cargo/bin"
rustup target add aarch64-apple-ios aarch64-apple-ios-sim x86_64-apple-ios aarch64-linux-android
rustc --version
cargo --version
condition: not(contains('${{parameters.vmImage}}', 'windows'))
displayName: "Install Rust toolchain (Unix)"

- powershell: |
Invoke-WebRequest -Uri https://win.rustup.rs/x86_64 -OutFile rustup-init.exe
.\rustup-init.exe -y --default-toolchain stable
echo "##vso[task.prependpath]$env:USERPROFILE\.cargo\bin"
rustc --version
cargo --version
condition: contains('${{parameters.vmImage}}', 'windows')
displayName: "Install Rust toolchain (Windows)"
9 changes: 2 additions & 7 deletions .github/jobs/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ jobs:

- script: |
sudo apt-get update
sudo apt-get install libjavascriptcoregtk-4.1-dev libgl1-mesa-dev libcurl4-openssl-dev libwayland-dev clang
sudo apt-get install libjavascriptcoregtk-4.1-dev libgl1-mesa-dev libcurl4-openssl-dev libwayland-dev libvulkan-dev clang
displayName: "Install packages"

- script: |
cmake -G Ninja -B build -D JAVASCRIPTCORE_LIBRARY=/usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-4.1.so -D NAPI_JAVASCRIPT_ENGINE=${{parameters.JSEngine}} -D CMAKE_BUILD_TYPE=RelWithDebInfo -D BX_CONFIG_DEBUG=ON -D CMAKE_UNITY_BUILD=$(UNITY_BUILD) -D OpenGL_GL_PREFERENCE=GLVND -D BABYLON_DEBUG_TRACE=ON -D ENABLE_SANITIZERS=$(SANITIZER_FLAG) .
cmake -G Ninja -B build -D JAVASCRIPTCORE_LIBRARY=/usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-4.1.so -D NAPI_JAVASCRIPT_ENGINE=${{parameters.JSEngine}} -D CMAKE_BUILD_TYPE=RelWithDebInfo -D CMAKE_UNITY_BUILD=$(UNITY_BUILD) -D BABYLON_DEBUG_TRACE=ON -D ENABLE_SANITIZERS=$(SANITIZER_FLAG) .
ninja -C build
displayName: "Build X11"

Expand All @@ -42,11 +42,6 @@ jobs:
xvfb-run ./Playground app:///Scripts/validation_native.js
displayName: "Validation Tests"

- script: |
cd build/Apps/UnitTests
xvfb-run ./UnitTests
displayName: "Unit Tests"

- task: PublishBuildArtifacts@1
inputs:
artifactName: "${{parameters.name}} Rendered Pictures"
Expand Down
14 changes: 0 additions & 14 deletions .github/jobs/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,3 @@ jobs:
useXcpretty: false
configuration: RelWithDebInfo
displayName: "Build Playground macOS"

- task: Xcode@5
inputs:
xcWorkspacePath: "buildmacOS/BabylonNative.xcodeproj"
scheme: "UnitTests"
sdk: "macosx"
useXcpretty: false
configuration: RelWithDebInfo
displayName: "Build UnitTests macOS"

- script: |
cd buildmacOS/Apps/UnitTests/RelWithDebInfo
./UnitTests
displayName: "Run UnitTests macOS"
2 changes: 1 addition & 1 deletion .github/jobs/test_install_win32.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ parameters:
type: string
- name: graphics_api
type: string
default: D3D11
default: D3D12

jobs:
- job: ${{parameters.name}}
Expand Down
24 changes: 2 additions & 22 deletions .github/jobs/win32.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ parameters:
- V8
- name: graphics_api
type: string
default: D3D11
default: D3D12
- name: enableSanitizers
type: boolean
default: false
Expand Down Expand Up @@ -42,9 +42,8 @@ jobs:
parameters:
vmImage: ${{parameters.vmImage}}

# BGFX_CONFIG_MAX_FRAME_BUFFERS is set so enough Framebuffers are available before V8 starts disposing unused ones
- script: |
cmake -G "Visual Studio 17 2022" -B build${{variables.solutionName}} -A ${{parameters.platform}} ${{variables.jsEngineDefine}} -D BX_CONFIG_DEBUG=ON -D GRAPHICS_API=${{parameters.graphics_api}} -D CMAKE_UNITY_BUILD=$(UNITY_BUILD) -D BGFX_CONFIG_MAX_FRAME_BUFFERS=256 -D BABYLON_DEBUG_TRACE=ON -D ENABLE_SANITIZERS=$(SANITIZER_FLAG)
cmake -G "Visual Studio 17 2022" -B build${{variables.solutionName}} -A ${{parameters.platform}} ${{variables.jsEngineDefine}} -D GRAPHICS_API=${{parameters.graphics_api}} -D CMAKE_UNITY_BUILD=$(UNITY_BUILD) -D BABYLON_DEBUG_TRACE=ON -D ENABLE_SANITIZERS=$(SANITIZER_FLAG)
displayName: "Generate ${{variables.solutionName}} solution"

- task: MSBuild@1
Expand All @@ -59,10 +58,6 @@ jobs:
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\Playground.exe" /v DumpType /t REG_DWORD /d 2
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\Playground.exe" /v DumpCount /t REG_DWORD /d 1
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\Playground.exe" /v DumpFolder /t REG_SZ /d "$(Build.ArtifactStagingDirectory)/Dumps"
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\UnitTests.exe"
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\UnitTests.exe" /v DumpType /t REG_DWORD /d 2
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\UnitTests.exe" /v DumpCount /t REG_DWORD /d 1
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\UnitTests.exe" /v DumpFolder /t REG_SZ /d "$(Build.ArtifactStagingDirectory)/Dumps"
displayName: "Enable Crash Dumps"

- powershell: |
Expand Down Expand Up @@ -112,21 +107,6 @@ jobs:
displayName: "Stage test app exe/pdb for publishing"
condition: failed()

- script: |
cd build${{variables.solutionName}}\Apps\UnitTests
cd RelWithDebInfo
UnitTests
displayName: "Unit Tests"

- task: CopyFiles@2
inputs:
sourceFolder: "build${{variables.solutionName}}/Apps/UnitTests/RelWithDebInfo"
contents: UnitTests.*
targetFolder: "$(Build.ArtifactStagingDirectory)/Dumps"
cleanTargetFolder: false
displayName: "Stage test app exe/pdb for publishing"
condition: failed()

- task: PublishBuildArtifacts@1
inputs:
artifactName: "${{variables.solutionName}} - ${{parameters.graphics_api}} Crash Dumps"
Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/build
/build_*
/target
**/target/
.DS_Store
.vscode
.idea/
cmake-build-*/
compile_commands.json
*.swp
*.swo
*~
9 changes: 0 additions & 9 deletions Apps/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
if((WIN32 AND NOT WINDOWS_STORE) AND GRAPHICS_API STREQUAL D3D11)
add_subdirectory(HeadlessScreenshotApp)
add_subdirectory(StyleTransferApp)
endif()

if(NOT ANDROID)
add_subdirectory(Playground)
endif()

if((WIN32 AND NOT WINDOWS_STORE) OR (APPLE AND NOT IOS AND NOT VISIONOS) OR (UNIX AND NOT ANDROID AND NOT APPLE))
add_subdirectory(UnitTests)
endif()

npm(install --silent --yes)
29 changes: 18 additions & 11 deletions Apps/Playground/Android/BabylonNative/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ target_include_directories(BabylonNativeJNI
PRIVATE ${PLAYGROUND_DIR})

target_link_libraries(BabylonNativeJNI
GLESv3
android
EGL
log
-lz
AndroidExtensions
Expand All @@ -29,16 +27,25 @@ target_link_libraries(BabylonNativeJNI
Canvas
Console
GraphicsDevice
NativeCamera
NativeCapture
NativeEncoding
NativeEngine
NativeInput
NativeOptimizations
NativeTracing
NativeXr
NativeWebGPU
ScriptLoader
ShaderCache
TestUtils
URL
Window
XMLHttpRequest)

target_compile_definitions(BabylonNativeJNI
PRIVATE BABYLON_NATIVE_PLAYGROUND_HAS_CANVAS=1)

if(ENABLE_SANITIZERS AND DEFINED BABYLON_NATIVE_SANITIZER_FLAGS)
target_compile_options(BabylonNativeJNI
PRIVATE -fsanitize=${BABYLON_NATIVE_SANITIZER_FLAGS} -fno-omit-frame-pointer)
target_link_options(BabylonNativeJNI
PRIVATE -fsanitize=${BABYLON_NATIVE_SANITIZER_FLAGS})

if(ANDROID)
# JNI dispatch can fault under ASAN on tagged-pointer ART internals (API 31 emulator).
# Keep ASAN on backend libraries and turn it off for this JNI entrypoint shim.
target_compile_options(BabylonNativeJNI PRIVATE -fno-sanitize=address)
endif()
endif()
40 changes: 32 additions & 8 deletions Apps/Playground/Android/BabylonNative/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if (project.hasProperty("jsEngine")) {
jsEngine = project.property("jsEngine")
}

def graphics_api = "OpenGL"
def graphics_api = "Vulkan"
def platformVersion = 21
if (project.hasProperty("GRAPHICS_API")) {
graphics_api = project.property("GRAPHICS_API")
Expand All @@ -33,29 +33,37 @@ android {

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
ndkVersion "23.1.7779620"
ndkVersion "28.2.13676358"
if (project.hasProperty("NDK_VERSION")) {
def NDKVersion = project.property("NDK_VERSION")
ndkVersion "${NDK_VERSION}"
}
externalNativeBuild {
cmake {
abiFilters "arm64-v8a", "armeabi-v7a", "x86", "x86_64"
if (project.hasProperty("ARM64Only")) {
abiFilters "arm64-v8a"
} else {
abiFilters "arm64-v8a", "armeabi-v7a", "x86", "x86_64"
}
arguments "-DANDROID_STL=c++_shared",
"-DENABLE_PCH=OFF",
"-DGRAPHICS_API=${graphics_api}",
"-DARCORE_LIBPATH=${arcore_libpath}/jni",
"-DNAPI_JAVASCRIPT_ENGINE=${jsEngine}",
"-DBABYLON_NATIVE_BUILD_APPS=ON",
"-DCMAKE_UNITY_BUILD=${unity_build}",
"-DBABYLON_DEBUG_TRACE=ON"
"-DBABYLON_NATIVE_POLYFILL_CANVAS=ON",
"-DBABYLON_NATIVE_POLYFILL_CANVAS_WGPU=ON",
"-DCMAKE_UNITY_BUILD=${unity_build}"
if (project.hasProperty("ENABLE_SANITIZERS")) {
arguments "-DENABLE_SANITIZERS=${project.property("ENABLE_SANITIZERS")}"
}
}
}
ndk {
if (project.hasProperty("ARM64Only")) {
abiFilters "arm64-v8a"
} else {
abiFilters "arm64-v8a", "armeabi-v7a", "x86"
abiFilters "arm64-v8a", "armeabi-v7a", "x86", "x86_64"
}
}
packagingOptions {
Expand All @@ -65,7 +73,7 @@ android {

externalNativeBuild {
cmake {
version '3.19.6+'
version '3.31.6'
path 'CMakeLists.txt'
buildStagingDirectory "../../../../Build/Android"
}
Expand All @@ -77,9 +85,25 @@ android {
}

buildTypes {
debug {
externalNativeBuild {
cmake {
arguments "-DBABYLON_DEBUG_TRACE=ON"
}
}
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
ndk {
debugSymbolLevel 'NONE'
abiFilters "arm64-v8a"
}
externalNativeBuild {
cmake {
arguments "-DBABYLON_DEBUG_TRACE=OFF", "-DCMAKE_BUILD_TYPE=Release", "-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON"
}
}
}
}
compileOptions {
Expand Down Expand Up @@ -119,4 +143,4 @@ tasks.configureEach { task ->
if ((task.name.contains("buildCMake") || task.name.contains("configureCMake")) && !task.name.contains("Clean")) {
task.dependsOn(extractNativeLibraries)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public class ExampleInstrumentedTest {
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.example.babylonnative.test", appContext.getPackageName());
final String packageName = appContext.getPackageName();
assertTrue(packageName.endsWith(".test"));
assertTrue(packageName.contains("babylonnative"));
}
}
}
Loading