Mali bridge (#517, by ASEbrahim) on the non-Adreno test branch

Squash of Droid-Deck/DroidDeck#517 (ASEbrahim/DroidDeck mali-bridge @ 6b823341): the Vulkan
bridge (tools/vkbridge) that runs the guest's Vulkan on the phone's own driver, with BC1-BC7,
clip/cull distance, vertex-divisor and depth-clip emulation and dma-heap memory sharing for Mali.
All of the bridge is ASEbrahim's work; squashed only to carry it on this test branch.

Combined with #570 on this branch, a device draws through exactly one path:
- Adreno: Turnip, unchanged (checked first; the bridge setting is ignored there).
- PowerVR / Xclipse with the system HAL and a render node: the system-Vulkan path (#570).
- Anything else with the Setup toggle on (Mali): the bridge.
This commit is contained in:
The412Banner committed 2026-10-12 18:34:49 -04:00
1 parent cf06f89c11
commit ee0fb08268
125 files changed
+119982 -12

No files matched your search

+21
View File
@@ -149,6 +149,9 @@ android {
release {
minifyEnabled false
signingConfig signingConfigs.testkey
// Mali bridge development fork: debuggable so `adb shell run-as` reaches the session
// logs and VkBridgeNative's development override (-Pdroiddeck.notDebuggable to drop).
debuggable !project.hasProperty('droiddeck.notDebuggable')
}
}
@@ -276,6 +279,24 @@ def buildRustStores = tasks.register('buildRustStores', Exec) {
if (!skipRust) android.sourceSets.main.jniLibs.srcDir(rustJniLibsDir)
tasks.named('preBuild').configure { dependsOn(buildRustStores) }
// The Mali bridge's server (tools/vkbridge, app/src/main/cpp/vkbridge) is a program, not a library:
// it runs beside the session as the app's child, so a driver crash ends that process and not the
// app. AGP's CMake integration packages only shared libraries, so the NDK's clang builds it here
// into one more jniLibs source, named libvkbridge_server.so so Android extracts it (the native
// library directory is the one place the app may exec from).
def vkbridgeJniLibsDir = layout.buildDirectory.dir('vkbridgeJniLibs')
def buildVkBridgeServer = tasks.register('buildVkBridgeServer', Exec) {
description = 'Builds the Vulkan bridge server (libvkbridge_server.so) with the NDK.'
inputs.dir(rootProject.file('tools/vkbridge/common'))
inputs.dir(layout.projectDirectory.dir('src/main/cpp/vkbridge'))
inputs.file(rootProject.file('tools/vkbridge/build-server-android.sh'))
outputs.dir(vkbridgeJniLibsDir)
commandLine 'bash', rootProject.file('tools/vkbridge/build-server-android.sh').absolutePath,
android.ndkDirectory.absolutePath, vkbridgeJniLibsDir.get().asFile.absolutePath
}
android.sourceSets.main.jniLibs.srcDir(vkbridgeJniLibsDir)
tasks.named('preBuild').configure { dependsOn(buildVkBridgeServer) }
dependencies {
// The runtime tarball is a zstd-compressed tar.
implementation 'com.github.luben:zstd-jni:1.5.2-3@aar'