mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-19 21:06:09 +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.
21 lines
807 B
Bash
Executable File
21 lines
807 B
Bash
Executable File
#!/bin/bash
|
|
# Compiles the BCn decoder variants into app/src/main/cpp/vkbridge/bc_spv.h (committed, so a build
|
|
# needs no shader compiler). Needs glslangValidator; regenerates bc_tables.glsl first.
|
|
set -eu
|
|
cd "$(dirname "$0")"
|
|
python3 gen_bc_tables.py
|
|
out=../../../app/src/main/cpp/vkbridge/bc_spv.h
|
|
tmp=$(mktemp -d)
|
|
{
|
|
echo "/* Generated by tools/vkbridge/shaders/build.sh from bc_decode.comp - do not edit. */"
|
|
echo "#pragma once"
|
|
echo "#include <stdint.h>"
|
|
} > "$out"
|
|
for f in BC1 BC2 BC3 BC4 BC5 BC6H BC7; do
|
|
name=spv_$(echo $f | tr A-Z a-z)
|
|
glslangValidator -V --target-env vulkan1.1 -DFMT_$f --vn "$name" -o "$tmp/$name.h" bc_decode.comp >/dev/null
|
|
grep -v '^ *//\|#pragma once' "$tmp/$name.h" | sed 's/^const uint32_t/static const uint32_t/' >> "$out"
|
|
done
|
|
rm -rf "$tmp"
|
|
echo "wrote $out"
|