From cf7f0d7c9662ca2d46152abac56e860d417dad33 Mon Sep 17 00:00:00 2001 From: Utkarsh Dalal Date: Mon, 2 Nov 2026 19:16:40 +0530 Subject: [PATCH] X11 sessions of a gamescope container use the Vulkan renderer Open container, test graphics and pre-install steps run on X11 even when the container's display server is gamescope. They picked the container's stored display renderer, a field the Graphics tab only shows for X11 containers, so a gamescope container silently kept the last X11 container's choice. On a RedMagic Astra (Android 16, GLES render engine) that leftover was the SurfaceFlinger renderer with compat mode off, which hands BGRA_8888 window buffers to surfaceflinger and aborts it on every open-container launch. The stored renderer now only applies to X11 containers; a gamescope container's X11 sessions use the Vulkan renderer, as its game session does. --- .../app/gamenative/ui/screen/xserver/XServerScreen.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/app/gamenative/ui/screen/xserver/XServerScreen.kt b/app/src/main/java/app/gamenative/ui/screen/xserver/XServerScreen.kt index 192513e994..212b2d984a 100644 --- a/app/src/main/java/app/gamenative/ui/screen/xserver/XServerScreen.kt +++ b/app/src/main/java/app/gamenative/ui/screen/xserver/XServerScreen.kt @@ -2127,11 +2127,16 @@ fun XServerScreen( // VirGL passthrough). Default to the legacy GL renderer for all // other containers as well. Uncheck the per-container useLegacyRenderer // setting to switch to the Vulkan renderer. - val useGLRenderer = isX11Display && (container.graphicsDriver == "virgl" || container.displayRenderer.equals("gl", true)) + // The stored display renderer is only shown, and only meant, for X11 containers: a gamescope + // container keeps whatever value the field had (the last X11 container's choice), so its X11 + // sessions (open container, test graphics, pre-install steps) use the Vulkan renderer like the + // game session does. + val displayRenderer = if (resolveDisplayX11(container)) container.displayRenderer else "vulkan" + val useGLRenderer = isX11Display && (container.graphicsDriver == "virgl" || displayRenderer.equals("gl", true)) val xServerViewInstance: XServerRendererView = if (useGLRenderer) { XServerViewGL(context, xServerToUse) } else { - XServerView(context, xServerToUse, if (isGamescopeSession) "vulkan" else container.displayRenderer) + XServerView(context, xServerToUse, if (isGamescopeSession) "vulkan" else displayRenderer) } // Install (or clear, when reusing a cached XServer) the input retarget sink.