Frame generation in the compositor: Win-FG Native and LSFG Native

The compositor was built with its frame-generation leg stubbed out. Bannerlator's
two engines and the DXBC translator they need now ride along, so extra frames
are generated on gamescope's final output — any game, nothing changed in the
runtime. Win-FG needs nothing; LSFG takes its shader chain from the user's own
Lossless Scaling, which in this app is installed from the Steam client and read
straight out of the runtime's library. One picker on the main screen: Off, or an
engine at 2x/3x/4x, applied live on the next return to the session.
This commit is contained in:
The412Banner committed 2026-09-19 15:14:45 -04:00
1 parent d46bd4a0c3
commit 0425023063
114 files changed
+36459

No files matched your search

@@ -16,6 +16,7 @@ import android.view.View
import android.view.WindowManager
import android.widget.FrameLayout
import com.steamdeck.launcher.core.FileUtils
import com.steamdeck.launcher.gpu.FrameGen
import com.steamdeck.launcher.gpu.TurnipDriver
import com.steamdeck.launcher.input.EvdevKeys
import com.steamdeck.launcher.input.OnScreenControls
@@ -121,6 +122,7 @@ class SessionActivity : Activity(), SurfaceHolder.Callback {
CompositorHost.newSession()
SessionService.start(this)
}
applyFrameGen()
}
override fun surfaceChanged(holder: SurfaceHolder, format: Int, width: Int, height: Int) {}
@@ -272,8 +274,23 @@ class SessionActivity : Activity(), SurfaceHolder.Callback {
Log.i(TAG, "on-screen controls " + (if (show) "shown" else "hidden"))
}
/**
* The saved frame-generation setting, pushed to the compositor. Off the main thread: LSFG's
* first use translates the shader chain out of Lossless.dll, which takes seconds.
*/
private fun applyFrameGen() {
val hz = refreshHz()
Thread({
val problem = FrameGen.apply(this, hz)
if (problem != null) runOnUiThread {
android.widget.Toast.makeText(this, problem, android.widget.Toast.LENGTH_LONG).show()
}
}, "frame-gen").start()
}
override fun onResume() {
super.onResume()
if (CompositorHost.isStarted) applyFrameGen()
(getSystemService(INPUT_SERVICE) as? InputManager)
?.registerInputDeviceListener(deviceListener, Handler(Looper.getMainLooper()))
updateOnScreenControls()