fix(session): only Steam-mode sessions receive the chosen Steam GPU drawing flag on the system-driver path

This commit is contained in:
Kurt Himebauch committed 2026-11-16 12:48:33 +00:00
1 parent e6bf86f5b2
commit 469b354640
3 files changed
+14 -9

No files matched your search

@@ -952,8 +952,8 @@ object SessionPrefs {
fun steamGpuDrawingShown(context: Context, systemDriverPath: Boolean = systemDriverSteamPath(context)): Boolean =
steamGpuCompositing(context) && (!systemDriverPath || prefs(context).contains("steamGpuCompositing"))
fun steamGpuCompositingChosen(context: Context, steamSession: Boolean): Boolean =
steamSession && steamGpuDrawingShown(context, true)
fun steamGpuCompositingChosen(context: Context, mode: String): Boolean =
mode == SessionService.MODE_STEAM && steamGpuDrawingShown(context, true)
fun systemDriverSteamPath(context: Context): Boolean =
!com.droiddeck.launcher.core.DeviceSupport.vkBridge(context) && !VenusComponent.wanted(context) &&
@@ -973,7 +973,7 @@ class SessionService : Service() {
val bridge = com.droiddeck.launcher.core.DeviceSupport.vkBridge(this)
if (SessionPrefs.systemDriverSteamPath(this)) {
SystemVulkanDriver.addEnvironment(this, guest)
if (SessionPrefs.steamGpuCompositingChosen(this, steamHere)) guest.add("BL_STEAM_GPU_COMPOSITING=1")
if (SessionPrefs.steamGpuCompositingChosen(this, SessionState.mode)) guest.add("BL_STEAM_GPU_COMPOSITING=1")
}
(if (bridge || venus) null else LinuxVulkanDriver.resolveIcdPath(this, linuxDriverId))
?.let { guest.add(LinuxVulkanDriver.ENV + "=" + it) }
@@ -43,22 +43,27 @@ class SteamGpuCompositingTest {
}
@Test fun untouchedPreferenceIsNotAChoice() {
assertFalse(SessionPrefs.steamGpuCompositingChosen(context, true))
assertFalse(SessionPrefs.steamGpuCompositingChosen(context, SessionService.MODE_STEAM))
}
@Test fun savedGpuChoiceIsAChoice() {
SessionPrefs.setSteamGpuCompositing(context, true)
assertTrue(SessionPrefs.steamGpuCompositingChosen(context, true))
assertTrue(SessionPrefs.steamGpuCompositingChosen(context, SessionService.MODE_STEAM))
}
@Test fun savedSoftwareChoiceIsNotChosenGpu() {
SessionPrefs.setSteamGpuCompositing(context, false)
assertFalse(SessionPrefs.steamGpuCompositingChosen(context, true))
assertFalse(SessionPrefs.steamGpuCompositingChosen(context, SessionService.MODE_STEAM))
}
@Test fun nonSteamSessionNeverReceivesChosenGpuCompositing() {
@Test fun desktopSessionNeverReceivesChosenGpuCompositing() {
SessionPrefs.setSteamGpuCompositing(context, true)
assertFalse(SessionPrefs.steamGpuCompositingChosen(context, false))
assertFalse(SessionPrefs.steamGpuCompositingChosen(context, SessionService.MODE_DESKTOP))
}
@Test fun runSessionNeverReceivesChosenGpuCompositing() {
SessionPrefs.setSteamGpuCompositing(context, true)
assertFalse(SessionPrefs.steamGpuCompositingChosen(context, SessionService.MODE_RUN))
}
@Test fun untouchedPreferenceShowsSoftwareOnSystemDriverPath() {
@@ -83,7 +88,7 @@ class SteamGpuCompositingTest {
@Test fun firstToggleFromUntouchedSystemDriverRowSavesGpu() {
SessionPrefs.setSteamGpuCompositing(context, !SessionPrefs.steamGpuDrawingShown(context, true))
assertTrue(SessionPrefs.steamGpuCompositingChosen(context, true))
assertTrue(SessionPrefs.steamGpuCompositingChosen(context, SessionService.MODE_STEAM))
}
@Test fun systemDriverPathIsOffOnDevicesWithoutThePowerVrDriver() {