native: perf telemetry, 2 frames in flight, 120 Hz pacing, GPU shadow map

- --perf-log CSV + logcat telemetry (perf_log.h, EterBase/PerfCounters.h),
  incl. display refresh rate / app vsync rate, thermal, CPU clocks;
  tools/pull_perf_logs.sh + tools/perf_summary.py
- Vulkan renderer: two frames in flight, in-frame texture uploads (no
  vkQueueWaitIdle), --fps-cap / --refresh-rate / --frames-in-flight
- Android: ANativeWindow_setFrameRate, ADPF performance hint,
  appCategory=game (ColorOS no longer drops to 60 Hz when idle)
- Character shadow map rendered on the GPU into an offscreen render target
  instead of CPU rasterization + per-frame 1 MB upload; --cpu-shadow keeps
  the old path. Device (120 Hz, 32 mobs): 75 -> ~115 fps, script thread
  8.9 -> 3.4 ms. draw_capture format v10.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-09-29 17:59:23 +09:00
co-authored by Claude Opus 5.5
parent 3e3708ef06
commit c2cc093ed0
16 changed files with 1883 additions and 261 deletions
+13 -3
View File
@@ -22,7 +22,17 @@ namespace
{
constexpr std::uint32_t kHandshake = 0x2468ace0;
constexpr int kHandshakeRetryLimit = 32; // game/src/desc.h HANDSHAKE_RETRY_LIMIT
constexpr int kIdleMs = 20000;
// A client that sends nothing for this long is dropped. MT_FAKE_IDLE_MS raises it for runs that stand
// still in game (perf measurements).
int idle_ms()
{
static const int ms = [] {
const char* value = std::getenv("MT_FAKE_IDLE_MS");
const long parsed = value && *value ? std::strtol(value, nullptr, 10) : 0;
return parsed >= 1000 ? static_cast<int>(parsed) : 20000;
}();
return ms;
}
int fake_mob_count()
{
@@ -127,7 +137,7 @@ struct FakeLoginServer::Connection
int ready = poll(&pfd, 1, 50);
if (ready == 0)
{
if ((waited += 50) >= kIdleMs)
if ((waited += 50) >= idle_ms())
return -1;
continue;
}
@@ -222,7 +232,7 @@ bool FakeLoginServer::Accept(int listener, Connection& c)
c.fd = accept(listener, nullptr, nullptr);
return c.fd >= 0;
}
if (waited >= kIdleMs)
if (waited >= idle_ms())
return Fail("no client connected");
}
return false;