F3 overlay like vanilla's DebugScreenOverlay (#363, #376, #377)

The overlay is drawn after screens and toasts, so it covers menus, and on
the title and options screens too (Gui.extractRenderState); F1 hides it
only in game. It lays out at the debug GUI scale (debugGuiScale, default
half the largest automatic scale) and shows the default profile's entries
sorted by id, split into vanilla's two columns: fps, version, position,
section position, performance impactors, system specs (CPU, display,
window, GPU, backend) and the integrated server's tick time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-15 22:12:56 +02:00
parent 13c4230431
commit 77127ccfed
7 changed files with 548 additions and 114 deletions
+4
View File
@@ -72,6 +72,8 @@ pub struct DebugCharts {
pub ping: SampleLogger,
/// `bandwidthLogger`: bytes received per tick.
pub bandwidth: SampleLogger,
/// `MinecraftServer.smoothedTickTimeMillis`.
pub smoothed_tick_ms: f32,
previous_tick: Option<Instant>,
bytes_seen: Option<i64>,
}
@@ -110,6 +112,7 @@ impl DebugCharts {
self.bandwidth.reset();
self.previous_tick = None;
self.bytes_seen = None;
self.smoothed_tick_ms = 0.0;
}
/// One integrated server tick that started at `started` and ran its
/// tick method for `method` (`MinecraftServer.logFullTickTime` and
@@ -123,6 +126,7 @@ impl DebugCharts {
.max(method);
self.previous_tick = Some(started);
self.tick_times.log_full([full, method, 0, full - method]);
self.smoothed_tick_ms = self.smoothed_tick_ms * 0.8 + method as f32 / 1e6 * 0.199_999_99;
}
/// `BandwidthDebugMonitor.tick`: the bytes received since the last
/// tick, from the connection's running total.