From 8cca105eb9287afeef2a8c47f0f0f4b42e3099d7 Mon Sep 17 00:00:00 2001 From: Sylpheed RE agent Date: Tue, 18 Aug 2026 20:15:35 +0000 Subject: [PATCH] [RE] log_ui_draws: bound the capture by cvar, and log the quad's Z MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three changes, each paid for by a measurement that could not be made without it: * `--ui_draw_capture_frames` / `--ui_draw_capture_max` replace the compiled-in 3-frame, 20k-draw bounds. A screen that redraws every frame needs 3; finding the frames in which a screen is BUILT needs hundreds, and that answer (the title screen never rebuilds — it submits the same 11 draws every frame) is only reachable by turning the window up. * the vertex dump prints all three floats. Attribute 0 of a UI quad is k_32_32_32_FLOAT, so the stream carries a Z — the game's own layer key, if it had one. It does not: every Z is 0.00000, which is what makes submission order the whole of the paint order. * positions print as floats rather than raw words, now that the format is known. --- src/xenia/gpu/command_processor.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/xenia/gpu/command_processor.cc b/src/xenia/gpu/command_processor.cc index b52a46d7d..cac3a14a2 100644 --- a/src/xenia/gpu/command_processor.cc +++ b/src/xenia/gpu/command_processor.cc @@ -327,11 +327,15 @@ void CommandProcessor::CaptureUiDrawForRE( if (!q) { break; } - uint32_t w0 = be_u32(q), w1 = be_u32(q + 4); - float f0, f1; + // Three floats, not two: attribute 0 of a UI quad is k_32_32_32_FLOAT, + // so the stream carries a Z per vertex — which is the game's own layer + // key if it has one, and the whole question this capture is asked. + uint32_t w0 = be_u32(q), w1 = be_u32(q + 4), w2 = be_u32(q + 8); + float f0, f1, f2; std::memcpy(&f0, &w0, 4); std::memcpy(&f1, &w1, 4); - ui_out << fmt::format(" [{:08X},{:08X}={:.2f},{:.2f}]", w0, w1, f0, f1); + std::memcpy(&f2, &w2, 4); + ui_out << fmt::format(" [{:.2f},{:.2f},z={:.5f}]", f0, f1, f2); } } }