The pacer counted only its own frames, so the client's 30 came on top (60 gave about 80), and it added no frames at all when the rate was out of reach. It now asks for a window's next frame once the interval since its last frame began has passed, and the client has had a third of a frame's time idle: all frames within the rate, and as many as the client can draw when it can't reach it. The engine's stats also break a frame's time down: sending to the renderer process, bytes sent, buffer updates. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
05a7be5d41
commit
399d934a08
6 files changed
+45
-18
No files matched your search
+14
-6
@@ -303,8 +303,10 @@ void Engine::endRendering()
|
||||
LARGE_INTEGER end, frequency;
|
||||
QueryPerformanceCounter(&end);
|
||||
QueryPerformanceFrequency(&frequency);
|
||||
frame_pacer::frameDrawn(window_, static_cast<double>(end.QuadPart - frameStart_.QuadPart) /
|
||||
static_cast<double>(frequency.QuadPart));
|
||||
const double seconds =
|
||||
static_cast<double>(end.QuadPart - frameStart_.QuadPart) / static_cast<double>(frequency.QuadPart);
|
||||
frameSeconds_ += seconds;
|
||||
frame_pacer::frameDrawn(window_, seconds);
|
||||
}
|
||||
ourTarget_ = nullptr;
|
||||
++frames_;
|
||||
@@ -315,14 +317,20 @@ void Engine::endRendering()
|
||||
const double seconds =
|
||||
static_cast<double>(ended.QuadPart - statsStart_.QuadPart) / static_cast<double>(frequency.QuadPart);
|
||||
statsStart_ = ended;
|
||||
const Recorder::Counters sent = recorder_->takeCounters();
|
||||
if (statsLogged_ < 6 || frames_ % 3000 == 0) {
|
||||
++statsLogged_;
|
||||
log::info("engine: last 300 frames: {:.0f} per second; drawTriangles {} (and {} with buffers not ours), "
|
||||
"drawTrianglesFromMemory {} (and {} without indices), point sprites {}, lines {}, 2D projections {}",
|
||||
300 / seconds, stats_.triangles, stats_.foreignTriangles, stats_.indexed, stats_.unindexed,
|
||||
stats_.sprites, stats_.lines, stats_.flat);
|
||||
log::info("engine: last 300 frames: {:.0f} per second; each {:.2f} ms beginRendering to endRendering, {:.2f} ms "
|
||||
"of it sending, {:.0f} KB sent, {:.1f} buffer updates ({:.0f} KB); drawTriangles {} (and {} with "
|
||||
"buffers not ours), drawTrianglesFromMemory {} (and {} without indices), point sprites {}, lines {}, "
|
||||
"2D projections {}",
|
||||
300 / seconds, frameSeconds_ * 1000 / 300, sent.sendSeconds * 1000 / 300,
|
||||
static_cast<double>(sent.bytes) / 1024 / 300, sent.bufferUpdates / 300.0,
|
||||
static_cast<double>(sent.bufferBytes) / 1024 / 300, stats_.triangles, stats_.foreignTriangles,
|
||||
stats_.indexed, stats_.unindexed, stats_.sprites, stats_.lines, stats_.flat);
|
||||
}
|
||||
stats_ = {};
|
||||
frameSeconds_ = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user