mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-18 20:36:04 +00:00
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.
27 lines
1.6 KiB
Bash
Executable File
27 lines
1.6 KiB
Bash
Executable File
#!/bin/bash
|
|
# Builds the Linux side of the bridge for the runtime (glibc, aarch64):
|
|
# tools/vkbridge/build-client-linux.sh <linuxfs-asset-dir> [cc]
|
|
# Produces, under the asset dir (staged into the runtime by SessionFiles):
|
|
# usr/local/lib/vkbridge/libvulkan_droidbridge.so the Vulkan ICD
|
|
# usr/local/share/vkbridge/droidbridge_icd.json its manifest
|
|
# usr/local/bin/droiddeck-vkbridge-smoke the session-start self-test
|
|
set -euo pipefail
|
|
d=$1
|
|
cc=${2:-aarch64-linux-gnu-gcc}
|
|
strip=${STRIP:-${cc%gcc}strip}
|
|
here=$(cd "$(dirname "$0")" && pwd)
|
|
inc="-I$here/third_party/Vulkan-Headers-1.4.341/include -I$here/common -I$here/common/gen"
|
|
mkdir -p "$d/usr/local/lib/vkbridge" "$d/usr/local/share/vkbridge" "$d/usr/local/bin"
|
|
"$cc" -O2 -fPIC -shared -fvisibility=hidden -DVKB_CLIENT -Wall -Wno-unused-parameter -Wno-missing-field-initializers \
|
|
$inc -I"$here/client" -I"$here/client/compat" -pthread \
|
|
-Wl,--no-undefined -Wl,-soname,libvulkan_droidbridge.so \
|
|
-o "$d/usr/local/lib/vkbridge/libvulkan_droidbridge.so" \
|
|
"$here"/client/*.c "$here/common/vkb_wire.c" "$here/common/gen/vkb_gen_structs.c" "$here/common/gen/vkb_gen_client.c" -ldl
|
|
"$strip" --strip-unneeded "$d/usr/local/lib/vkbridge/libvulkan_droidbridge.so"
|
|
"$cc" -O2 -Wall $inc -I"$here/tests" -o "$d/usr/local/bin/droiddeck-vkbridge-smoke" "$here/tests/smoke.c" -ldl
|
|
"$strip" --strip-unneeded "$d/usr/local/bin/droiddeck-vkbridge-smoke"
|
|
cat > "$d/usr/local/share/vkbridge/droidbridge_icd.json" <<JSON
|
|
{"file_format_version": "1.0.0", "ICD": {"library_path": "/usr/local/lib/vkbridge/libvulkan_droidbridge.so", "api_version": "1.4.341"}}
|
|
JSON
|
|
echo "built the vkbridge client into $d"
|