mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-12-05 20:45:43 +00:00
fix(session): the Steam interface GPU drawing choice reaches the system-driver path
This commit is contained in:
1 parent
f65e7a3d43
commit
46518cf21d
5 files changed
+33
-3
No files matched your search
@@ -949,6 +949,9 @@ object SessionPrefs {
|
||||
return prefs(context).getBoolean("steamGpuCompositing", true)
|
||||
}
|
||||
|
||||
fun steamGpuCompositingChosen(context: Context): Boolean =
|
||||
prefs(context).contains("steamGpuCompositing") && steamGpuCompositing(context)
|
||||
|
||||
fun steamGpuCompositingAllowed(): Boolean =
|
||||
!com.droiddeck.launcher.core.DeviceSupport.adreno() && !com.droiddeck.launcher.core.DeviceSupport.mali()
|
||||
|
||||
|
||||
@@ -973,6 +973,7 @@ class SessionService : Service() {
|
||||
val bridge = com.droiddeck.launcher.core.DeviceSupport.vkBridge(this)
|
||||
if (!bridge && !venus && SystemVulkanDriver.usesDefault(linuxDriverId)) {
|
||||
SystemVulkanDriver.addEnvironment(this, guest)
|
||||
if (SessionPrefs.steamGpuCompositingChosen(this)) guest.add("BL_STEAM_GPU_COMPOSITING=1")
|
||||
}
|
||||
(if (bridge || venus) null else LinuxVulkanDriver.resolveIcdPath(this, linuxDriverId))
|
||||
?.let { guest.add(LinuxVulkanDriver.ENV + "=" + it) }
|
||||
|
||||
@@ -41,4 +41,18 @@ class SteamGpuCompositingTest {
|
||||
SessionPrefs.setSteamGpuCompositing(context, true)
|
||||
assertTrue(SessionPrefs.steamGpuCompositing(context))
|
||||
}
|
||||
|
||||
@Test fun untouchedPreferenceIsNotAChoice() {
|
||||
assertFalse(SessionPrefs.steamGpuCompositingChosen(context))
|
||||
}
|
||||
|
||||
@Test fun savedGpuChoiceIsAChoice() {
|
||||
SessionPrefs.setSteamGpuCompositing(context, true)
|
||||
assertTrue(SessionPrefs.steamGpuCompositingChosen(context))
|
||||
}
|
||||
|
||||
@Test fun savedSoftwareChoiceIsNotChosenGpu() {
|
||||
SessionPrefs.setSteamGpuCompositing(context, false)
|
||||
assertFalse(SessionPrefs.steamGpuCompositingChosen(context))
|
||||
}
|
||||
}
|
||||
@@ -1491,8 +1491,12 @@ case $mode in
|
||||
bl_steam_path="/usr/local/libexec/droiddeck-steam:$PATH"
|
||||
export DISABLE_GAMESCOPE_WSI=1 LIBGL_KOPPER_DISABLE=true
|
||||
bl_steam_angle=gl
|
||||
bl_steam_presentation=(-cef-disable-gpu-compositing)
|
||||
echo "== steam: system PowerVR uses OpenGL/DRI3 through Zink with software CEF compositing"
|
||||
if [ "${BL_STEAM_GPU_COMPOSITING:-0}" = 1 ]; then
|
||||
echo "== steam: system PowerVR uses OpenGL/DRI3 through Zink with GPU CEF compositing"
|
||||
else
|
||||
bl_steam_presentation=(-cef-disable-gpu-compositing)
|
||||
echo "== steam: system PowerVR uses OpenGL/DRI3 through Zink with software CEF compositing"
|
||||
fi
|
||||
elif [ "${BL_STEAM_SOFT_COMPOSITING:-}" = 1 ]; then
|
||||
bl_steam_presentation=(-cef-disable-gpu-compositing)
|
||||
echo "== steam: open driver pair - software CEF compositing, GPU raster"
|
||||
|
||||
@@ -21,7 +21,7 @@ class SteamPresentationTest(unittest.TestCase):
|
||||
+ 'steam_client=("$steam_root/steamrtarm64/steam")\n'
|
||||
+ source[command:command_end])
|
||||
env = dict(os.environ)
|
||||
for key in ("BL_STEAM_GL_PRESENT", "BL_STEAM_SOFT_COMPOSITING", "DISABLE_GAMESCOPE_WSI", "LIBGL_KOPPER_DISABLE"):
|
||||
for key in ("BL_STEAM_GL_PRESENT", "BL_STEAM_GPU_COMPOSITING", "BL_STEAM_SOFT_COMPOSITING", "DISABLE_GAMESCOPE_WSI", "LIBGL_KOPPER_DISABLE"):
|
||||
env.pop(key, None)
|
||||
if enabled is not None:
|
||||
env["BL_STEAM_GL_PRESENT"] = enabled
|
||||
@@ -81,6 +81,14 @@ class SteamPresentationTest(unittest.TestCase):
|
||||
self.assertIn("-cef-disable-gpu-compositing", result["args"])
|
||||
self.assertIn("-cef-use-angle=gl", result["args"])
|
||||
|
||||
def test_powervr_presentation_honors_chosen_gpu_compositing(self):
|
||||
result = self.launch("1", {"BL_STEAM_GPU_COMPOSITING": "1"})
|
||||
self.assertNotIn("-cef-disable-gpu-compositing", result["args"])
|
||||
self.assertIn("-cef-force-gpu", result["args"])
|
||||
self.assertIn("-cef-use-angle=gl", result["args"])
|
||||
self.assertEqual(result["disable"], "1")
|
||||
self.assertEqual(result["kopper"], "true")
|
||||
|
||||
def test_disabled_option_preserves_existing_environment(self):
|
||||
result = self.launch("0", {"DISABLE_GAMESCOPE_WSI": "0", "LIBGL_KOPPER_DISABLE": "false"})
|
||||
self.assertIn("-cef-use-angle=vulkan", result["args"])
|
||||
|
||||
Reference in new issue
Block a user