mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-12-05 20:45:43 +00:00
fix(setup): the Steam interface GPU drawing row shows the value the system-driver path uses
An untouched preference means software compositing on the system-driver path, so the row shows off there and the first tap turns GPU drawing on.
This commit is contained in:
1 parent
babcc271b7
commit
1d6959a9ec
4 files changed
+41
-5
No files matched your search
@@ -1526,8 +1526,8 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
gameDebugLogsNeedsRestart = gameDebugLogsNeedsRestart()
|
||||
},
|
||||
onSteamGpuDrawing = {
|
||||
SessionPrefs.setSteamGpuCompositing(this, !SessionPrefs.steamGpuCompositing(this))
|
||||
steamGpuDrawing = SessionPrefs.steamGpuCompositing(this)
|
||||
SessionPrefs.setSteamGpuCompositing(this, !SessionPrefs.steamGpuDrawingShown(this))
|
||||
steamGpuDrawing = SessionPrefs.steamGpuDrawingShown(this)
|
||||
},
|
||||
onGraphicsLogs = {
|
||||
SessionPrefs.setDetailedGraphicsLogs(this, !SessionPrefs.detailedGraphicsLogs(this))
|
||||
@@ -3098,7 +3098,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
agentCommands = com.droiddeck.launcher.agent.AgentAccess.commandsEnabled(this)
|
||||
graphicsLogs = SessionPrefs.detailedGraphicsLogs(this)
|
||||
buildWatermark = SessionPrefs.buildWatermarkEnabled(this)
|
||||
steamGpuDrawing = SessionPrefs.steamGpuCompositing(this)
|
||||
steamGpuDrawing = SessionPrefs.steamGpuDrawingShown(this)
|
||||
bridgeFellBack = SessionPrefs.bridgeFellBack(this)
|
||||
bridgeFellBackMemory = SessionPrefs.bridgeFellBackForMemory(this)
|
||||
clearCachedApps = SessionPrefs.clearCachedApps(this)
|
||||
|
||||
@@ -949,8 +949,15 @@ object SessionPrefs {
|
||||
return prefs(context).getBoolean("steamGpuCompositing", true)
|
||||
}
|
||||
|
||||
fun steamGpuDrawingShown(context: Context, systemDriverPath: Boolean = systemDriverSteamPath(context)): Boolean =
|
||||
steamGpuCompositing(context) && (!systemDriverPath || prefs(context).contains("steamGpuCompositing"))
|
||||
|
||||
fun steamGpuCompositingChosen(context: Context, steamSession: Boolean): Boolean =
|
||||
steamSession && prefs(context).contains("steamGpuCompositing") && steamGpuCompositing(context)
|
||||
steamSession && steamGpuDrawingShown(context, true)
|
||||
|
||||
fun systemDriverSteamPath(context: Context): Boolean =
|
||||
!com.droiddeck.launcher.core.DeviceSupport.vkBridge(context) && !VenusComponent.wanted(context) &&
|
||||
com.droiddeck.launcher.gpu.SystemVulkanDriver.usesDefault(linuxDriver(context))
|
||||
|
||||
fun steamGpuCompositingAllowed(): Boolean =
|
||||
!com.droiddeck.launcher.core.DeviceSupport.adreno() && !com.droiddeck.launcher.core.DeviceSupport.mali()
|
||||
|
||||
@@ -971,7 +971,7 @@ class SessionService : Service() {
|
||||
linuxDriverId,
|
||||
)
|
||||
val bridge = com.droiddeck.launcher.core.DeviceSupport.vkBridge(this)
|
||||
if (!bridge && !venus && SystemVulkanDriver.usesDefault(linuxDriverId)) {
|
||||
if (SessionPrefs.systemDriverSteamPath(this)) {
|
||||
SystemVulkanDriver.addEnvironment(this, guest)
|
||||
if (SessionPrefs.steamGpuCompositingChosen(this, steamHere)) guest.add("BL_STEAM_GPU_COMPOSITING=1")
|
||||
}
|
||||
|
||||
@@ -60,4 +60,33 @@ class SteamGpuCompositingTest {
|
||||
SessionPrefs.setSteamGpuCompositing(context, true)
|
||||
assertFalse(SessionPrefs.steamGpuCompositingChosen(context, false))
|
||||
}
|
||||
|
||||
@Test fun untouchedPreferenceShowsSoftwareOnSystemDriverPath() {
|
||||
assertFalse(SessionPrefs.steamGpuDrawingShown(context, true))
|
||||
}
|
||||
|
||||
@Test fun untouchedPreferenceShowsGpuOnOpenDriverPath() {
|
||||
assertTrue(SessionPrefs.steamGpuDrawingShown(context, false))
|
||||
}
|
||||
|
||||
@Test fun savedGpuChoiceIsShownOnBothPaths() {
|
||||
SessionPrefs.setSteamGpuCompositing(context, true)
|
||||
assertTrue(SessionPrefs.steamGpuDrawingShown(context, true))
|
||||
assertTrue(SessionPrefs.steamGpuDrawingShown(context, false))
|
||||
}
|
||||
|
||||
@Test fun savedSoftwareChoiceIsShownOnBothPaths() {
|
||||
SessionPrefs.setSteamGpuCompositing(context, false)
|
||||
assertFalse(SessionPrefs.steamGpuDrawingShown(context, true))
|
||||
assertFalse(SessionPrefs.steamGpuDrawingShown(context, false))
|
||||
}
|
||||
|
||||
@Test fun firstToggleFromUntouchedSystemDriverRowSavesGpu() {
|
||||
SessionPrefs.setSteamGpuCompositing(context, !SessionPrefs.steamGpuDrawingShown(context, true))
|
||||
assertTrue(SessionPrefs.steamGpuCompositingChosen(context, true))
|
||||
}
|
||||
|
||||
@Test fun systemDriverPathIsOffOnDevicesWithoutThePowerVrDriver() {
|
||||
assertFalse(SessionPrefs.systemDriverSteamPath(context))
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user