com um clique
bindings-synchronization
Guidelines and SOP for synchronizing public C++ API changes (methods, enums, options structs) to Java (Android JNI) and JavaScript/TypeScript (Web/WASM Embind).
Menu
Guidelines and SOP for synchronizing public C++ API changes (methods, enums, options structs) to Java (Android JNI) and JavaScript/TypeScript (Web/WASM Embind).
Standard verification pipeline to execute after modifying C++ source or header files. Use this skill to format includes, build the engine, and run core tests.
Enforce the strict topological header inclusion layering and reordering rules in Filament. Use this skill when adding or modifying `#include` directives in C++ source or header files.
Enforce C++ static thread safety annotations and correct synchronization primitives. Use this skill when designing multi-threaded classes or editing guarded member fields.
Build, deploy, run, and benchmark Filament binaries on connected Android devices or emulators. Use this skill for compiling, pushing, and executing Android tests or benchmarks.
Clean and build Filament targets for development, debugging, and production. Use this skill whenever you need to clean the workspace or compile desktop targets.
Execute unit tests and performance benchmarks for Filament on desktop platforms. Use this skill to run and filter tests or benchmarks locally.
| name | bindings-synchronization |
| description | Guidelines and SOP for synchronizing public C++ API changes (methods, enums, options structs) to Java (Android JNI) and JavaScript/TypeScript (Web/WASM Embind). |
When making changes to public Filament C++ APIs, AI agents must ensure the changes are mirrored in the Java and JavaScript/TypeScript binding layers.
You must check and update the language bindings if your changes touch any public headers under filament/include/filament/, specifically:
View, Engine, Camera, LightManager, RenderableManager).AmbientOcclusionOptions, BloomOptions, FogOptions).
[!IMPORTANT] If you modify options structs defined in
filament/include/filament/Options.h, you must run the beamsplitter tool. The tool parsesOptions.hand automatically updates Java bindings, JavaScript/TypeScript bindings, and C++ JSON serialization files.Run it via:
cd tools/beamsplitter && go run .
BlendMode, QualityLevel, AntiAliasing under filament/include/filament/ or nested inside classes).All JNI JNI-exported functions use automatic symbol resolution (dynamic mapping), meaning they are mapped by signature rather than a static registration table.
android/filament-android/src/main/java/com/google/android/filament/<ClassName>.javaandroid/filament-android/src/main/cpp/<ClassName>.cpppublic (unless the API is strictly internal to the Java package). Follow Java naming conventions (camelCase).setFoo), always add the corresponding Getter (e.g., isFoo or getFoo).private static native.extern "C" JNIEXPORT <ReturnType> JNICALL Java_com_google_android_filament_<ClassName>_<NativeMethodName>.jboolean using (jboolean) or static_cast<jboolean>().Filament uses Emscripten's Embind to export C++ APIs to JS.
web/filament-js/jsbindings.cppweb/filament-js/jsenums.cppweb/filament-js/filament.d.tsweb/filament-js/extensions.jsjsbindings.cpp within the corresponding class_<ClassName>("<JSClassName>") block using .function("methodName", &ClassName::methodName).filament.d.ts to match any changes. Every bound C++ method should have a corresponding declaration inside export class <ClassName> to avoid IDE type errors.BloomOptions), make sure to:
jsbindings.cpp using .field("fieldName", &ClassName::Options::fieldName).filament.d.ts to include the new properties.extensions.js contains a prototype-overrides wrapper for merging the options (e.g., Filament.View.prototype.setBloomOptions). Update the default options object if needed.Before concluding a task:
filament.d.ts are 100% synchronized.