Skip to content

Commit ee34a92

Browse files
docs: add osu-framework and veldrid fork sections to README
Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/1d3c6971-e9fd-4074-9f8e-0bcb8c85965d Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
1 parent 908946d commit ee34a92

1 file changed

Lines changed: 99 additions & 0 deletions

File tree

β€ŽREADME.mdβ€Ž

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,105 @@ A native C++ Vulkan probe (`vulkan_bridge.cpp`) checks the GPU's capabilities at
127127
| `generate-keystore.yml` | Helper to generate a persistent signing keystore for consistent APK signatures across builds. |
128128
| `ci.yml` | Full CI with desktop tests + Android/iOS compile-only verification. |
129129

130+
### πŸ”§ osu-framework fork ([winnerspiros/osu-framework](https://github.com/winnerspiros/osu-framework))
131+
132+
The upstream ppy/osu uses the official `ppy.osu.Framework` NuGet package. This fork replaces it with a git submodule pointing to a custom framework fork β€” enabling deep platform-level changes that aren't possible through the public API.
133+
134+
#### .NET 10 upgrade
135+
136+
The entire framework is upgraded from .NET 8 β†’ **.NET 10** with C# 14 language features. All target frameworks are updated (`net10.0`, `net10.0-android`, `net10.0-ios`).
137+
138+
#### Audio latency reduction
139+
140+
The biggest audio change lives in the framework's `AudioManager`:
141+
142+
| Setting | Upstream (ppy) | This fork |
143+
|---------|----------------|-----------|
144+
| `Bass.DeviceBufferLength` | Default (10 ms) | **5 ms** |
145+
| `Bass.PlaybackBufferLength` | Default (100 ms) | **25 ms** (Android), **30 ms** (iOS) |
146+
| `Bass.UpdatePeriod` | Default (5 ms) | **2 ms** (Android), **3 ms** (iOS) |
147+
| AAudio backend | Not enabled | **Enabled** via `Bass.Configure(67, 1)` |
148+
| Sample rate | 44100 Hz | **48000 Hz** (native rate for AAudio and CoreAudio) |
149+
150+
The `BassAudioMixer.Handle` property is made **public** so the Android Oboe bridge can access mixer handles directly instead of using fragile reflection.
151+
152+
#### Android Vulkan as primary renderer
153+
154+
In the framework's `GameHost`, the renderer order for Android is changed:
155+
156+
- **Upstream:** OpenGL only
157+
- **This fork:** Vulkan (primary) β†’ OpenGL (fallback)
158+
159+
A diagnostic check logs a warning if the device has Vulkan < 1.3, since osu! Veldrid uses Vulkan 1.3 features (dynamic rendering, synchronisation2).
160+
161+
#### Android platform layer
162+
163+
The framework fork has a full `osu.Framework.Android` project with:
164+
- `AndroidGameActivity` / `AndroidGameHost` β€” Activity lifecycle and host integration
165+
- `AndroidStorage` β€” Content resolver file access
166+
- `AndroidFileSelector` β€” Native file picker
167+
- Release build optimisations: profiled AOT, LLVM, partial trimming, IL stripping
168+
169+
#### iOS platform layer
170+
171+
A complete `osu.Framework.iOS` project with:
172+
- `IOSGameHost` / `IOSWindow` β€” iOS host and Metal-backed window
173+
- AOT compilation with Mono interpreter fallback
174+
- Native framework references for BASS, FFmpeg, and Metal
175+
- macOS-only framework stripping (removes ApplicationServices/Quartz from iOS linker)
176+
177+
#### Performance hot-path optimisations
178+
179+
Several commits eliminate allocations and reduce lock contention in the framework:
180+
181+
- **LINQ elimination** in `Dropdown.cs`, `FlowContainer.cs`, and shader pipelines β€” removed redundant enumerations that allocated on every keyboard event or layout pass
182+
- **`System.Threading.Lock`** migration β€” replaced `lock(object)` with the modern `Lock` type in `RendererDisposalQueue`, `SampleStore`, `VeldridTexture`, `GLTexture`, and others for lower-overhead synchronisation
183+
- **GL state thrashing reduction** β€” avoids redundant OpenGL state changes in the renderer
184+
- **Texture upload pipeline** optimisations for faster asset loading on mobile
185+
186+
#### Dependency updates
187+
188+
Key packages updated beyond upstream versions:
189+
190+
| Package | Upstream | Fork |
191+
|---------|----------|------|
192+
| `ppy.SDL3-CS` | 2026.302.0 | 2026.320.0 |
193+
| `SixLabors.ImageSharp` | 3.1.11 | 3.1.12 |
194+
| `Newtonsoft.Json` | 13.0.3 | 13.0.4 |
195+
| `JetBrains.Annotations` | 2023.3.0 | 2025.2.4 |
196+
| `StbiSharp` | 1.1.0 | 1.2.1 |
197+
| `Xamarin.AndroidX.Window` | 1.2.0.1 | 1.5.1.2 |
198+
199+
### πŸ–₯️ Veldrid fork ([winnerspiros/veldrid](https://github.com/winnerspiros/veldrid))
200+
201+
[Veldrid](https://github.com/veldrid/veldrid) is the cross-platform GPU abstraction layer used by osu-framework. Upstream ppy/osu uses it via a NuGet package (`ppy.Veldrid`). This fork replaces that with a git submodule containing a customised Veldrid with Android graphics support and performance improvements.
202+
203+
#### Android Vulkan rendering
204+
205+
The main reason this fork exists β€” full Vulkan support on Android:
206+
207+
- **`VkSurfaceUtil.cs`** β€” Creates Vulkan surfaces from `ANativeWindow` via `VK_KHR_android_surface`
208+
- **`VkGraphicsDevice.cs`** β€” Detects and enables Android-specific Vulkan extensions
209+
- **`AndroidRuntime.cs`** β€” P/Invoke bindings to `ANativeWindow_fromSurface()`, `ANativeWindow_setBuffersGeometry()`, `ANativeWindow_release()`
210+
- **`SwapchainSource.cs`** β€” `AndroidSurfaceSwapchainSource` class for passing native windows to Vulkan
211+
212+
#### OpenGL ES support
213+
214+
For devices where Vulkan isn't available:
215+
216+
- **EGL bindings** (`EGLNative.cs`) β€” Complete EGL 1.4 API for OpenGL ES 2.0/3.0 context creation
217+
- **`OpenGLGraphicsDevice.cs`** β€” `initializeANativeWindow()` for Android surface initialisation via EGL
218+
- **GLES stencil fixes** β€” Proper stencil buffer initialisation (critical for osu!'s UI rendering)
219+
220+
#### .NET 10 and performance
221+
222+
- Upgraded to `net10.0` across all projects
223+
- **`System.Threading.Lock`** migration across all backends (D3D11, Vulkan, OpenGL, Metal) β€” 11 files updated
224+
- **UTF-8 string literals** (`"vkCreate..."u8`) for zero-allocation Vulkan function lookups
225+
- **Vulkan fence early-out** β€” uses `vkGetFenceStatus()` to avoid blocking waits
226+
- **Screen tearing support** β€” `AllowTearing` property in `VkSwapchain` for lowest-latency present modes
227+
- **D3D11 platform annotations** β€” `[SupportedOSPlatform("windows")]` enables safe trimming on non-Windows platforms
228+
130229
---
131230

132231
## Download

0 commit comments

Comments
Β (0)