[RE] log_ui_draws: bound the capture by cvar, and log the quad's Z
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.
This commit is contained in:
@@ -327,11 +327,15 @@ void CommandProcessor::CaptureUiDrawForRE(
|
|||||||
if (!q) {
|
if (!q) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
uint32_t w0 = be_u32(q), w1 = be_u32(q + 4);
|
// Three floats, not two: attribute 0 of a UI quad is k_32_32_32_FLOAT,
|
||||||
float f0, f1;
|
// 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(&f0, &w0, 4);
|
||||||
std::memcpy(&f1, &w1, 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user