[RE] Arm the UI draw capture on F10 unconditionally

The capture used to require --log_ui_draws at LAUNCH, which put an unexplained
variable into every navigation run: across 12 runs, launching with the flag
correlates with the title screen refusing (A) — 0 of 7 with it, 4 of 5 without.

No mechanism was found. The cvar is read in exactly one place, when F10 arms a
capture, and F10 was never pressed in those runs; the per-draw hook is a single
relaxed atomic load; the startup config dumps of the two arms are byte-identical.
An interleaved A/B also ruled out the obvious confound (boot duration): the
latest title of all, 268 s, ACCEPTED (A), while a 232 s title refused.

So rather than keep a variable nobody can explain in the path of every run, arm
on F10 the way the ship capture next to it already does. The cvar stays, marked
obsolete, so existing command lines still parse. Verified: F10 with no capture
flags at all writes xenia_re_ui_draws_01.log.
This commit is contained in:
Sylpheed RE agent
2026-08-19 00:36:34 +00:00
parent 043002a871
commit 4cd019b769

View File

@@ -92,7 +92,9 @@ DEFINE_bool(
DEFINE_bool(
log_ui_draws, false,
"Reverse-engineering aid: arm a UI DRAW-ORDER capture with F10. Writes "
"OBSOLETE — the UI draw-order capture is armed by F10 unconditionally now, "
"so this flag is no longer needed and is kept only so old command lines "
"still parse. Reverse-engineering aid: F10 writes "
"every draw of the next few swapped frames to xenia_re_ui_draws_NN.log in "
"SUBMISSION ORDER and undeduplicated, with each draw's bound texture base "
"and dimensions. For recovering the paint order of a 2D screen, which "
@@ -194,9 +196,14 @@ void NoteUiDrawCaptureSwap() {
}
void RequestUiDrawCapture() {
if (!cvars::log_ui_draws) {
return;
}
// No cvar gate. It used to require `log_ui_draws`, which meant a run that
// wanted a UI capture had to pass the flag at LAUNCH — and launching with it
// correlates, across 12 runs, with the title screen refusing (A) (0 of 7 with
// the flag, 4 of 5 without). No mechanism was found for that and boot time
// does not explain it either, so rather than keep an unexplained variable in
// every navigation run, the arming is now unconditional: F10 arms it, exactly
// as it arms the ship capture next to it. The cost when nobody presses F10 is
// one relaxed atomic load per draw.
uint32_t gen = g_ui_capture_gen.fetch_add(1, std::memory_order_relaxed) + 1;
g_ui_swap_count.store(0, std::memory_order_relaxed);
g_ui_capture_armed.store(true, std::memory_order_relaxed);