Merge #570 (PowerVR + Xclipse system Vulkan) into the non-Adreno test branch

# Conflicts:
#	.github/workflows/build.yml
#	app/src/main/java/com/droiddeck/launcher/session/SessionFiles.kt
#	app/src/main/java/com/droiddeck/launcher/session/SessionService.kt
#	tools/build_local.sh
#	tools/dxvk/build.sh
#	tools/linuxfs/overlay/usr/local/bin/droiddeck-session
#	tools/release/runtime_inputs.py
#	tools/tests/test_runtime_inputs.py
This commit is contained in:
The412Banner committed 2026-10-12 18:34:02 -04:00
commit 56dc433673
104 files changed
+7206 -206

No files matched your search

@@ -305,6 +305,60 @@ def mark_install_scripts(command, env):
print("droiddeck-game-env: install scripts not marked (%s)" % error, file=sys.stderr)
class SystemGraphicsError(ValueError):
pass
def system_graphics_launch(command, env):
"""Use the APK's PowerVR compatibility files only for actual Proton game launches."""
runtime = env.get("DROIDDECK_POWERVR_RUNTIME")
if not runtime or not game_id(env) or len(command) < 3 or command[1] != "waitforexitandrun":
return command, env
directory = Path(runtime)
if not directory.is_absolute():
raise SystemGraphicsError("system Vulkan runtime path is not absolute")
# run-proton.py picks the same payload by name; Xclipse needs a DXVK within 128 bytes of push data.
payload = env.get("DROIDDECK_HYBRIS_DXVK") or "dxvk"
if not payload.startswith("dxvk") or "/" in payload:
raise SystemGraphicsError("invalid DXVK payload name: %s" % payload)
required = (
"run-proton.py", "wsi/libVkLayer_window_system_integration.so",
"wsi/VkLayer_window_system_integration.json", "lib/libVkLayer_hybris_compat.so",
*("%s/%s/%s.dll" % (payload, arch, name) for arch in ("x32", "x64")
for name in ("d3d8", "d3d9", "d3d10core", "d3d11", "dxgi")),
)
try:
for name in required:
path = directory / name
if not path.is_file() or not path.stat().st_size:
raise SystemGraphicsError("missing system Vulkan component: %s" % name)
wrapper = directory / "run-proton.py"
if not os.access(wrapper, os.X_OK):
raise SystemGraphicsError("system Vulkan Proton wrapper is not executable")
except OSError as error:
raise SystemGraphicsError("system Vulkan component is unreadable: %s" % error) from error
result = dict(env)
layers = "VK_LAYER_window_system_integration:" + env.get("DROIDDECK_HYBRIS_LAYERS", "VK_LAYER_HYBRIS_compat")
result.update({
"HYBRIS_BC_TEXTURES": "dxvk",
"VK_LAYER_PATH": ":".join(filter(None, (str(directory / "wsi"), str(directory / "lib"),
env.get("DROIDDECK_HYBRIS_LAYER_PATH")))),
"VK_INSTANCE_LAYERS": layers,
"ENABLE_GAMESCOPE_WSI": "0",
"VK_LOADER_LAYERS_DISABLE": "*gamescope*",
"DISABLE_VK_LAYER_VALVE_steam_fossilize_1": "1",
})
for name in ("DISABLE_WSI_LAYER", "PROTON_USE_WINED3D", "ENABLE_VK_LAYER_VALVE_steam_fossilize_1"):
result.pop(name, None)
return [str(wrapper), *command], result
def exec_proton(command, env):
# Synchronization selection has already picked the actual Proton executable.
command, env = system_graphics_launch(command, env)
os.execvpe(command[0], command, env)
def main():
command = sys.argv[1:]
if not command:
@@ -344,13 +398,17 @@ def main():
launch, launch_env = select_sync(command, env, sync)
if launch[0] != command[0]:
try:
os.execvpe(launch[0], launch, launch_env)
exec_proton(launch, launch_env)
except OSError as error:
print("droiddeck-game-env: %s could not start (%s); stock launch" % (launch[0], error), file=sys.stderr)
launch, launch_env = command, without_pack(launch_env, env)
record_stock(sync, launch, launch_env)
os.execvpe(launch[0], launch, launch_env)
exec_proton(launch, launch_env)
if __name__ == "__main__":
sys.exit(main())
try:
sys.exit(main())
except SystemGraphicsError as error:
print("droiddeck-game-env: PowerVR graphics runtime unavailable (%s)" % error, file=sys.stderr)
sys.exit(1)
@@ -273,7 +273,13 @@ if [ -z "${BL_INSIDE:-}" ]; then
echo "== gamescope: games at ${nested}x${height} stretched to the ${width}x${height} output"
fi
fi
args=(--backend wayland --expose-wayland -f -W "$width" -H "$height" -w "$nested" -h "$height")
backend=${BL_GAMESCOPE_BACKEND:-wayland}
case "$backend" in
wayland) ;;
sdl) export SDL_VIDEODRIVER=wayland ;;
*) echo "== unsupported gamescope backend: $backend"; exit 64 ;;
esac
args=(--backend "$backend" --expose-wayland -f -W "$width" -H "$height" -w "$nested" -h "$height")
[ "$nested" != "$width" ] && args+=(-S stretch) && export BL_STRETCHED=1
# -r is what gamescope advertises as the refresh rate, and what a game reads as the display's.
# Left unset it defaults to 60, so a 120 Hz panel offers only 60 Hz in game settings. The FPS
@@ -823,6 +829,21 @@ BUSCONF
export STEAM_RUNTIME=1
export LD_LIBRARY_PATH=$steam_root/steamrtarm64:$steam_root/steamrtarm64/panorama${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
export SDL_VIDEO_X11_DGAMOUSE=0
bl_steam_path=$PATH
bl_steam_angle=vulkan
bl_steam_presentation=()
if [ "${BL_STEAM_GL_PRESENT:-}" = 1 ]; then
bl_steam_path="/usr/local/libexec/droiddeck-steam:$PATH"
# Keep the system driver for GPU rendering, but present Steam through ordinary DRI3.
# The inner compositor has neither android_wlegl nor the bridge's TAWC-DRI extension.
export DISABLE_GAMESCOPE_WSI=1 LIBGL_KOPPER_DISABLE=true
bl_steam_angle=gl
# CEF renders correctly internally, but its accelerated shared-texture output is
# corrupted on this path. Software web compositing avoids that handoff; Gamescope
# and the selected game driver still use the system GPU.
bl_steam_presentation=(-cef-disable-gpu-compositing)
echo "== steam: system PowerVR uses OpenGL/DRI3 through Zink with software CEF compositing"
fi
# Decky is optional and session scoped: the app's marker opts in, and this supervisor is
# reaped with the client session. Native ARM64 runs directly. A legacy x86_64 asset is used
# only when its recorded architecture says so and droiddeck-fex has FEX and its runtime ready.
@@ -880,7 +901,9 @@ BUSCONF
# desktop's launchers ask for. KDE owns its windows when BL_DESKTOP=1.
_bl_ui=(-gamepadui)
[ "${BL_STEAM_UI:-}" = desktop ] && _bl_ui=()
_bl_cef=(-cef-force-gpu -cef-use-gl=angle -cef-use-angle=vulkan)
# bl_steam_angle / bl_steam_presentation default to the Adreno values (vulkan, none); only
# the system-PowerVR path (BL_STEAM_GL_PRESENT=1) changes them.
_bl_cef=(-cef-force-gpu "${bl_steam_presentation[@]}" -cef-use-gl=angle "-cef-use-angle=$bl_steam_angle")
if [ "${BL_DESKTOP:-}" = 1 ] && [ "${BL_STEAM_UI:-}" = desktop ]; then
# KDE uses QPainter/shm on Android. CEF's Vulkan buffers cannot be
# presented there; its software path keeps the library and dialogs on KDE.
@@ -1052,6 +1075,9 @@ BUSCONF
/usr/local/bin/droiddeck-steam-desktop-ui &
desktop_ui_pid=$!
fi
# Keep Valve's optional webhelper CPU pinning from aborting browser startup.
PATH="$bl_steam_path" \
BL_STEAM_WEBHELPER="$steam_root/steamrtarm64/steamwebhelper" \
"$steam_root/steamrtarm64/steam" "${_bl_ui[@]}" "${_bl_cdp[@]}" "${_bl_lang[@]}" -clientbeta "$steam_channel" \
-no-cef-sandbox -cef-ozone-platform=x11 "${_bl_cef[@]}" "$@"
rc=$?
@@ -0,0 +1,17 @@
#!/bin/bash
# Staged as taskset in a PATH directory used only by the Steam client.
# Valve's ARM64 helper uses `taskset 0x7c /path/to/steamwebhelper ...` and exits
# before starting the browser when Android denies sched_setaffinity.
set -u
if [ "$#" -ge 2 ] && [[ "$1" =~ ^(0[xX])?[0-9a-fA-F]+$ ]] &&
[ -n "${BL_STEAM_WEBHELPER:-}" ] && [ "$2" -ef "$BL_STEAM_WEBHELPER" ]; then
mask=$1
shift
# Pin this wrapper before exec; never retry a helper that has already run.
if ! /usr/bin/taskset -p "$mask" "$$" >/dev/null 2>&1; then
echo "droiddeck: Steam helper CPU pinning unavailable; using the allowed CPUs" >&2
fi
exec -- "$@"
fi
# Queries, existing-process changes, and other programs retain taskset's behavior.
exec /usr/bin/taskset "$@"
@@ -198,6 +198,9 @@ bl_components() {
local -A cm_sums=()
while IFS=$'\\t' read -r scope t want comp rel sum src; do
[ -n "$scope" ] || continue
# The selected system PowerVR runtime supplies DXVK at launch. Keep saved selections
# for a later manual-driver session without rewriting this Proton's bundled files now.
[ "$comp" = dxvk ] && [ -n "${DROIDDECK_POWERVR_RUNTIME:-}" ] && continue
cm_rows+=("$comp"$'\\t'"$rel"$'\\t'"$sum"$'\\t'"$src")
[ "$src" != "-" ] && [ -f "$base/$rel" ] && cm_files+=("$base/$rel")
done <<< "$cm_selected"