mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-20 21:35:59 +00:00
fix(appimage): emulators and other AppImage programs get the game GPU setting (#2288)
The session sets TU_DEBUG=sysmem for the Steam client's interface and hands games their own value in DROIDDECK_GAME_TU_DEBUG, which droiddeck-game-env applies to Steam launches (#1188). droiddeck-appimage-run never did, so emulators and other AppImage programs rendered every pass through system memory instead of Turnip's per render pass choice. Apply the game value in droiddeck-appimage-run the same way: an empty value unsets TU_DEBUG, any other value replaces it. Chromium-based apps, like the Steam client's own interface, keep the session's setting.
This commit is contained in:
1 parent
3fef1f3fa1
commit
3bb279f635
3 files changed
+27
-2
No files matched your search
@@ -25,6 +25,12 @@ if [ -n "$(find -H "$APPDIR" -maxdepth 4 \( -name chrome-sandbox -o -name chrome
|
||||
flags+=(--ozone-platform=x11)
|
||||
fi
|
||||
fi
|
||||
if [ -n "${DROIDDECK_GAME_TU_DEBUG+set}" ]; then
|
||||
if [ ${#flags[@]} -eq 0 ]; then
|
||||
if [ -n "$DROIDDECK_GAME_TU_DEBUG" ]; then export TU_DEBUG=$DROIDDECK_GAME_TU_DEBUG; else unset TU_DEBUG; fi
|
||||
fi
|
||||
unset DROIDDECK_GAME_TU_DEBUG
|
||||
fi
|
||||
qt=$(cat "$dir/qt" 2>/dev/null)
|
||||
case $qt in wayland|xcb) ;; *) qt=auto ;; esac
|
||||
wayland=${GAMESCOPE_WAYLAND_DISPLAY:-${WAYLAND_DISPLAY:-}}
|
||||
|
||||
@@ -6,7 +6,7 @@ import unittest
|
||||
from pathlib import Path
|
||||
|
||||
RUN = Path(__file__).resolve().parents[1] / "linuxfs/overlay/usr/local/bin/droiddeck-appimage-run"
|
||||
KEYS = ("QT_QPA_PLATFORM", "WAYLAND_DISPLAY", "SDL_VIDEODRIVER", "XDG_SESSION_TYPE", "QT_WAYLAND_DISABLE_WINDOWDECORATION", "DISABLE_GAMESCOPE_WSI")
|
||||
KEYS = ("TU_DEBUG", "DROIDDECK_GAME_TU_DEBUG", "QT_QPA_PLATFORM", "WAYLAND_DISPLAY", "SDL_VIDEODRIVER", "XDG_SESSION_TYPE", "QT_WAYLAND_DISABLE_WINDOWDECORATION", "DISABLE_GAMESCOPE_WSI")
|
||||
QUICK = ("usr/lib/libQt6Quick.so.6", "usr/lib/libvulkan.so.1", "usr/plugins/platforms/libqwayland-generic.so")
|
||||
RUN_MODE = {"GAMESCOPE_WAYLAND_DISPLAY": "gamescope-0", "WAYLAND_DISPLAY": "gamescope-0", "DISPLAY": ":0",
|
||||
"QT_QPA_PLATFORM": "xcb", "SDL_VIDEODRIVER": "x11", "XDG_SESSION_TYPE": "x11"}
|
||||
@@ -128,5 +128,24 @@ class AppImageRunTest(unittest.TestCase):
|
||||
self.assertEqual("wayland;xcb", env["QT_QPA_PLATFORM"])
|
||||
|
||||
|
||||
def test_a_program_drops_the_sessions_sysmem_like_a_steam_game(self):
|
||||
env, _ = self.launch(dict(RUN_MODE, TU_DEBUG="sysmem", DROIDDECK_GAME_TU_DEBUG=""))
|
||||
self.assertEqual("unset", env["TU_DEBUG"])
|
||||
self.assertEqual("unset", env["DROIDDECK_GAME_TU_DEBUG"])
|
||||
|
||||
def test_a_program_gets_the_game_driver_setting(self):
|
||||
env, _ = self.launch(dict(RUN_MODE, TU_DEBUG="sysmem", DROIDDECK_GAME_TU_DEBUG="gmem"))
|
||||
self.assertEqual("gmem", env["TU_DEBUG"])
|
||||
|
||||
def test_a_chromium_app_keeps_the_session_setting(self):
|
||||
self.bundle("chrome_100_percent.pak")
|
||||
env, _ = self.launch(dict(RUN_MODE, TU_DEBUG="sysmem", DROIDDECK_GAME_TU_DEBUG=""))
|
||||
self.assertEqual("sysmem", env["TU_DEBUG"])
|
||||
|
||||
def test_without_the_game_setting_the_session_value_stays(self):
|
||||
env, _ = self.launch(dict(RUN_MODE, TU_DEBUG="sysmem"))
|
||||
self.assertEqual("sysmem", env["TU_DEBUG"])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user