From de4f0e3cbf70bd682c4c4c57051491c1e5412427 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 1 May 2026 14:37:23 +0000 Subject: [PATCH 1/3] Initial plan From ff02ef030559e4a231316a0371bd43e6b9b32cc5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 1 May 2026 14:39:54 +0000 Subject: [PATCH 2/3] Android: gate SurfaceHolder.SetFormat(Rgba8888) to Vulkan renderer only Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/c3bba099-2e22-4796-bf2e-920e891cbcb7 Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com> --- osu.Android/OsuGameActivity.cs | 45 ++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/osu.Android/OsuGameActivity.cs b/osu.Android/OsuGameActivity.cs index 3cacc0d47b44..3d7068425e39 100644 --- a/osu.Android/OsuGameActivity.cs +++ b/osu.Android/OsuGameActivity.cs @@ -253,25 +253,38 @@ protected override void OnCreate(Bundle? savedInstanceState) if (holder != null) { - // Request RGBA8888 on the Android SurfaceHolder unconditionally BEFORE - // registering our callback. Without this, Android defaults to RGB565 - // for the SurfaceView when no renderer explicitly requests a different - // format — SDL3 only calls setFormat(RGBA8888) for OpenGL, not Vulkan, - // so Vulkan sessions receive an RGB565 ANativeWindow. An RGB565 swapchain - // is incompatible with our 8-bit-per-channel rendering pipeline and - // causes a black screen followed by a native Draw-thread crash on Adreno - // GPUs (evidenced by SDL_PIXELFORMAT_RGB565 + "drawable size 3088×1440" - // in the runtime log for every Vulkan crash session). RGBA8888 is what - // OpenGL already uses and is the correct baseline for all renderers. - // Calling SetFormat before AddCallback ensures the format is stamped - // on the SurfaceHolder before SDL creates the VkAndroidSurfaceKHR. - try + // Only request RGBA8888 on the SurfaceHolder when the configured + // renderer is Vulkan. SDL3 already calls setFormat(RGBA8888) for + // OpenGL/GLES from its own EGL surface initialization, and calling + // setFormat() a second time AFTER SDL has bound its EGL surface + // forces Android to recreate the surface (surfaceDestroyed → + // surfaceCreated → surfaceChanged) mid-frame. That: + // 1. Trips the 250ms drawThreadAcknowledgedTeardown wait in + // AndroidGameSurface.SurfaceDestroyed (visible warning in HUD). + // 2. Leaves SDL's EGL surface bound to a destroyed ANativeWindow, + // causing eglSwapBuffers to silently no-op → permanent black + // screen while Update/Audio/Input keep running. + // SDL3 does NOT call setFormat on the Vulkan path, so Vulkan still + // needs this stamping to avoid the RGB565 default that crashes Adreno. + bool isVulkan = false; + try { isVulkan = LogManagement.IsVulkanConfigured(); } + catch (Exception e) { Debug.WriteLine($"[osu!] SurfaceHolder format gate: IsVulkanConfigured failed, defaulting to skip SetFormat: {e.Message}"); } + + if (isVulkan) { - holder.SetFormat(global::Android.Graphics.Format.Rgba8888); + try + { + holder.SetFormat(global::Android.Graphics.Format.Rgba8888); + Logger.Log("[osu!] SurfaceHolder.SetFormat(Rgba8888) applied (Vulkan renderer).", LoggingTarget.Runtime, LogLevel.Important); + } + catch (Exception e) + { + Debug.WriteLine($"[osu!] Failed to request RGBA8888 surface format: {e.Message}"); + } } - catch (Exception e) + else { - Debug.WriteLine($"[osu!] Failed to request RGBA8888 surface format: {e.Message}"); + Logger.Log("[osu!] SurfaceHolder.SetFormat skipped (OpenGL/Auto renderer — SDL3 handles format).", LoggingTarget.Runtime, LogLevel.Important); } holder.AddCallback(this); From 61c3e3057d618bc67b4899f9b0382d658f9ba99d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 1 May 2026 16:12:35 +0000 Subject: [PATCH 3/3] bump ppy.osu.Framework to 2026.501.2 (includes veldrid 4.9.18) Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/93057211-bba3-4d19-a4d6-fbad9da58d26 Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com> --- osu.Android.props | 2 +- osu.Game/osu.Game.csproj | 2 +- osu.iOS.props | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Android.props b/osu.Android.props index a01fc928fca8..624b85909a47 100644 --- a/osu.Android.props +++ b/osu.Android.props @@ -99,7 +99,7 @@ - +