Skip to content

DigitalisX64/sample_hello_digitalis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hello Digitalis Samples

ARM64-only sample apps for testing Digitalis binary translation.

Credits

Most sample modules in this project are ported from the Android NDK Samples repository by Google, licensed under the Apache License 2.0. Modifications were made to build as ARM64-only modules for testing Digitalis binary translation.

The original hello-vulkan module was written for the Digitalis project.

Modules

Module Description Build
hello-vulkan Vulkan triangle renderer ./gradlew :hello-vulkan:assembleDebug
hello-jni Basic JNI — calls C code from Kotlin Activity ./gradlew :hello-jni:assembleDebug
hello-jniCallback JNI callbacks — native code calls Java methods ./gradlew :hello-jniCallback:assembleDebug
exceptions C++ exception handling across JNI boundary ./gradlew :exceptions:assembleDebug
bitmap-plasma Plasma effect rendered to Android Bitmap via JNI ./gradlew :bitmap-plasma:assembleDebug
hello-gl2 OpenGL ES 2.0 triangle via JNI ./gradlew :hello-gl2:assembleDebug
gles3jni OpenGL ES 3.0 with instanced rendering ./gradlew :gles3jni:assembleDebug
native-activity Pure C++ NativeActivity with EGL/GLES rendering ./gradlew :native-activity:assembleDebug
native-audio OpenSL ES audio playback and recording ./gradlew :native-audio:assembleDebug
native-codec Video playback using Native Media Codec API ./gradlew :native-codec:assembleDebug
native-midi Android Native MIDI API (requires Android 10+) ./gradlew :native-midi:assembleDebug
sensor-graph Accelerometer sensor visualization with OpenGL ./gradlew :sensor-graph:assembleDebug
camera-basic Camera2 NDK preview and JPEG capture ./gradlew :camera-basic:assembleDebug
camera-texture-view Camera preview with TextureView rendering ./gradlew :camera-texture-view:assembleDebug
teapots-classic Utah teapot with GLES 2.0 and touch gestures ./gradlew :teapots-classic:assembleDebug
teapots-more GLES 3.0 instanced teapots rendering ./gradlew :teapots-more:assembleDebug
teapots-textured Textured teapot with ImageDecoder (Android 11+) ./gradlew :teapots-textured:assembleDebug
endless-tunnel 3D tunnel game with scene management and GLES 2.0 ./gradlew :endless-tunnel:assembleDebug
sanitizers Address/UB sanitizer demo (HWASan/ASan/UBSan) ./gradlew :sanitizers:assembleDebug
unit-test Native unit testing with GoogleTest via Prefab ./gradlew :unit-test:assembleDebug
vectorization SIMD vectorization benchmarks (matrix multiplication) ./gradlew :vectorization:assembleDebug
orderfile Binary optimization with linker order files ./gradlew :orderfile:assembleDebug

Prerequisites

  • Android SDK with NDK (cmake 3.22.1+)
  • glslangValidator for GLSL-to-SPIR-V shader compilation (included in the NDK's shader-tools/ or install via the Vulkan SDK)

Build

Build all modules:

./gradlew assembleDebug

Install and Run

On the Digitalis emulator (x86_64 with NativeBridge):

adb install hello-vulkan/build/outputs/apk/debug/hello-vulkan-debug.apk
adb shell am start -n com.example.hellodigitalis/android.app.NativeActivity

The apps are ARM64-only (arm64-v8a). They will not run on x86_64 devices without NativeBridge binary translation.

Digitalis Compatibility

Tested on the Digitalis x86_64 emulator with ARM64-to-x86_64 binary translation.

22 PASS / 0 CRASH — all modules run successfully.

Module Status Notes
hello-vulkan PASS Vulkan triangle renders correctly
hello-jni PASS Basic JNI works
hello-jniCallback PASS JNI callbacks work
exceptions PASS C++ exceptions work across JNI
bitmap-plasma PASS Plasma effect renders correctly
hello-gl2 PASS GLES 2.0 triangle renders
gles3jni PASS GLES 3.0 instanced rendering works
native-activity PASS NativeActivity with EGL/GLES works
native-audio PASS OpenSL ES audio works
native-codec PASS Media codec playback works
native-midi PASS MIDI API loads (no device on emulator)
sensor-graph PASS Accelerometer graph renders
camera-basic PASS Camera2 NDK works
camera-texture-view PASS Camera TextureView works
teapots-classic PASS GLES 2.0 teapot renders
teapots-more PASS GLES 3.0 instanced teapots render
teapots-textured PASS Textured teapot renders (with ifstream workaround)
endless-tunnel PASS 3D tunnel game runs
sanitizers PASS Sanitizer demo runs
unit-test PASS GoogleTest runs
vectorization PASS SIMD benchmarks run
orderfile PASS Order file demo runs

Known Workarounds

  • teapots-textured: std::ifstream construction can throw under binary translation due to std::locale initialization. Wrapped in try-catch to fall through to AAssetManager path (the correct approach for APK assets anyway).
  • gles3jni: Shader source uses #version 300 es with precision mediump float — required explicit precision qualifiers for compatibility.

About

The sample code to verify DigtitalisX64

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors