From 3d240c890e5b58da0d49a739053579c42370e101 Mon Sep 17 00:00:00 2001 From: iChris4 Date: Wed, 23 Sep 2026 00:59:14 +0200 Subject: [PATCH] Log the draw calls a frame costs beside its GPU timings The Android frame-rate line already says where the wall clock went; what it could not say is how many draw commands the recorded frame holds, which is what the mono pass and both eye replays each pay for. An overlay that stops draws merging shows up here long before it shows up as a frame rate. Co-Authored-By: Claude Opus 5 --- aurora-main/lib/aurora.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/aurora-main/lib/aurora.cpp b/aurora-main/lib/aurora.cpp index fea61d2..7685f44 100644 --- a/aurora-main/lib/aurora.cpp +++ b/aurora-main/lib/aurora.cpp @@ -2276,7 +2276,13 @@ void record_frame_telemetry() { if (fpsLog) { static auto windowStart = std::chrono::steady_clock::now(); static uint32_t windowFrames = 0; + // Draw calls are what a recorded frame costs three times over (mono and both eyes), so they belong beside the + // GPU timings: an overlay that stops draws merging shows up here long before it shows up as a frame rate. + static uint64_t windowDraws = 0; + static uint64_t windowMerged = 0; ++windowFrames; + windowDraws += gfx::g_stats.drawCallCount; + windowMerged += gfx::g_stats.mergedDrawCallCount; const auto now = std::chrono::steady_clock::now(); const std::chrono::duration elapsed = now - windowStart; if (elapsed.count() >= 5.0) { @@ -2292,9 +2298,14 @@ void record_frame_telemetry() { const double encode = msPerFrame(g_workerEncodeNs); Log.info("Game frame rate {:.1f} FPS ({} frames in {:.2f} s); per frame the producer waited {:.2f} ms for " "DONE and {:.2f} ms for SEALED; the worker spent {:.2f} ms sealing, {:.2f} ms waiting for the " - "prepare permit, {:.2f} ms preparing the next frame and {:.2f} ms encoding", + "prepare permit, {:.2f} ms preparing the next frame and {:.2f} ms encoding; {:.0f} draw calls a " + "frame ({:.0f} primitives merged away)", windowFrames / elapsed.count(), windowFrames, elapsed.count(), waitDone, waitSealed, seal, - permitWait, prepare, encode); + permitWait, prepare, encode, + static_cast(windowDraws) / std::max(windowFrames, 1u), + static_cast(windowMerged) / std::max(windowFrames, 1u)); + windowDraws = 0; + windowMerged = 0; if (const std::string gpuTiming = gfx::gpu_timing_report(); !gpuTiming.empty()) { Log.info("{}", gpuTiming); }