Never make the client wait for drawing, or hold up its steps
CI / build (push) Successful in 1m15s

The renderer process now takes each view's chunks on a thread of its own as
they come, and draws the newest frame on its main thread: the client no longer
waits for the previous frame to be drawn (on a VM, 22 of a frame's 25 ms).

The adapter records the client's steps (SceneViewer::step, by replacing its
entry in the exported IFrameListener vtable, after checking it), and the frame
pacer doesn't ask for a frame that wouldn't end before the next step is due: a
late step made the client catch up two at once, which showed as hitches. While
the renderer process covers the view, the client's renderer doesn't begin or
present frames, which could wait for the display.

The engine's stats now include the time in the client renderer's methods.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
dhkatzandClaude Opus 5.5 committed 2026-10-28 21:30:46 -07:00
1 parent 399d934a08
commit 065c7e9300
11 files changed
+280 -78

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
#pragma once
// Our hooks into SceneWindow.dll's scene code, installed once, the first time an engine is made. Each replaces a
// pointer IMVU's code calls through (an entry of an exported vtable), after checking it holds the function expected,
// with ours, which calls IMVU's: nothing else is changed, and nothing is if a check fails (an unexpected
// SceneWindow.dll: the hooks' features are then off, and the client runs as it would without them).
//
// - SceneViewer::step (the IFrameListener vtable): the client's tick, 30 times a second (SceneWindow.dll's runApp
// calls stepFrame, which steps each scene viewer). Recorded, for the frame pacer and for drawing between ticks.
#include <cstdint>
namespace t5de::scene_hooks {
void install();
// Whether the hooks are installed.
[[nodiscard]] bool installed();
// When a scene viewer last stepped (QueryPerformanceCounter), or 0 if none has.
[[nodiscard]] std::int64_t lastStep();
} // namespace t5de::scene_hooks