Open water without dark blocks; the F3 stats panel in every build

Water: on hosts of 32-lane waves the water's two tiled light programs
(water_shading:CS_TransmissionVolumetrics_Tiled 5dc3b25986622949 and
_Tiled_LocalLights 6f225b641c5b0708) translate in the wave-wide form only,
and in that form leave whole tiles of open water dark (around boats, along
shores, under bridges) at about 15 ms of the card a frame. They are left out
there (pipeline/make.rs); VICTORY_WATER_LIGHT=1, or WATER LIGHT in the F1
menu, runs them as before. Runs on a copy of a save on the first boat ride,
RTX 5070, Series X 1440p DLSS Quality: 25 fps with the blocks before, 30 fps
without them after; the water is darker and bluer without that light.
fxceless/victory-fork's README of 2026-11-27 names the same two programs and
form.

Stats panel: host/panel.rs is built without the diagnostics feature too (the
recording time is counted in diagnostics builds only), has a frame generation
line, and is switched by F3 or by STATS PANEL (F3) in the menu, live. The FPS
line at the top is hidden while the panel shows.

README: both, and where the panel is.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
trustno1-coderandClaude Fable 5.2 committed 2026-11-26 20:39:26 -08:00
1 parent 9d6300fa2d
commit 35c156087e
5 files changed
+93 -22

No files matched your search

+5 -3
View File
@@ -13,7 +13,7 @@
//! (DLSS mode, frame generation, frame rate, console, picture size), which it
//! turns into the layer's switches; the others are the switches themselves.
//!
//! In every build (the stats panel is in diagnostics builds only). Drawn as
//! In every build, as the stats panel is. Drawn as
//! that panel is: white text on a black box, copied onto the swap chain's
//! buffer, in the middle of the picture.
@@ -62,6 +62,7 @@ const ITEMS: &[Item] = &[
Item { var: "VICTORY_MENU_FRAMEGEN", label: "FRAME GENERATION", values: &[("0", "OFF"), ("2", "2X"), ("3", "3X"), ("4", "4X"), ("5", "5X"), ("6", "6X (MOST)")], live: false },
Item { var: "VICTORY_MENU_FPS", label: "FRAME RATE CAP", values: &[("1000", "NONE"), ("120", "120"), ("60", "60"), ("30", "30 (THE GAME)")], live: false },
Item { var: "VICTORY_FPS_LINE", label: "FPS AT THE TOP", values: &[("1", "ON"), ("0", "OFF")], live: true },
Item { var: "VICTORY_PANEL", label: "STATS PANEL (F3)", values: &[("0", "OFF"), ("1", "ON")], live: true },
Item { var: "VICTORY_MENU_CONSOLE", label: "CONSOLE", values: &[("series-x", "SERIES X"), ("series-s", "SERIES S (FASTER)")], live: false },
Item { var: "VICTORY_MENU_RES", label: "SERIES X PICTURE", values: &[("1440", "2560X1440"), ("1080to1440", "1080P TO 1440P"), ("4k", "3840X2160")], live: false },
// The layer's switches.
@@ -70,6 +71,7 @@ const ITEMS: &[Item] = &[
Item { var: "VICTORY_AMBIENT_SPECULAR", label: "REFLECTION ESTIMATE", values: ON_UNSET, live: false },
Item { var: "VICTORY_AMBIENT_AIR", label: "FOG CAP", values: &[("1.5", "1.5"), ("1", "1"), ("2", "2"), ("", "NONE")], live: false },
Item { var: "VICTORY_BVH_BUILDER", label: "RAY TRACING (SLOW, BROKEN)", values: UNSET_ON, live: false },
Item { var: "VICTORY_WATER_LIGHT", label: "WATER LIGHT", values: &[("", "OFF (NO DARK BLOCKS)"), ("1", "ON (GREEN, DARK BLOCKS)")], live: false },
Item { var: "VICTORY_LEAVE_OUT", label: "HEAT HAZE AND DECAL DEFRAG", values: &[("02384a60fda6f2d0,731a39171b568298", "LEFT OUT"), ("", "RUN (SLOWER, SMEARS)")], live: false },
Item { var: "VICTORY_EARLY_DEPTH", label: "EARLY DEPTH TEST", values: ON_UNSET, live: false },
Item { var: "VICTORY_WC_NO_BACK", label: "SKIP BIG COPY-BACKS", values: ON_UNSET, live: false },
@@ -106,8 +108,7 @@ fn fps_line() -> Option<String> {
if !fps_line_on().load(Ordering::Relaxed) {
return None;
}
// The stats panel has that corner (diagnostics builds, F3).
#[cfg(feature = "diagnostics")]
// The stats panel has that corner (F3), and says the same.
if super::panel::shown().load(Ordering::Relaxed) {
return None;
}
@@ -336,6 +337,7 @@ impl Menu {
// Off (0) or the frames shown for each one rendered, from the next present on.
"VICTORY_MENU_FRAMEGEN" => crate::streamline::set_framegen(value.parse().unwrap_or(0)),
"VICTORY_FPS_LINE" => fps_line_on().store(value != "0", Ordering::Relaxed),
"VICTORY_PANEL" => super::panel::shown().store(value == "1", Ordering::Relaxed),
_ => {}
}
}
+50 -8
View File
@@ -1,5 +1,7 @@
//! Diagnostics: the run's numbers on the picture (`VICTORY_PANEL=1`; off by
//! default; F3 shows and hides it while our window has the focus): white
//! The run's numbers on the picture, in every build (`VICTORY_PANEL=1`; off
//! by default; F3 or the settings menu shows and hides it while our window
//! has the focus; the time spent recording is counted in diagnostics builds
//! only): white
//! text on a black box in the upper left corner of what is shown, so that a
//! screenshot carries them, with what it costs itself on the submitting
//! thread. Made again twice a second from the counters of
@@ -28,7 +30,7 @@ const GLYPH: (u32, u32) = (5, 7);
const CELL: (u32, u32) = (6, 9);
/// Characters in a line, lines, and the box's rim in dots.
const COLUMNS: u32 = 40;
const LINES: u32 = 9;
const LINES: u32 = 10;
const RIM: u32 = 3;
/// The texts are put into one of these in turn: the card reads the others,
@@ -116,7 +118,10 @@ const COUNTERS: usize = 11;
impl Counters {
fn now() -> Counters {
use super::{CARD_CLOCK_US, COPY_BACK, PREPARING};
use crate::copystat::{C, peek};
#[cfg(feature = "diagnostics")]
let recording = crate::copystat::peek(crate::copystat::C::RecordNs);
#[cfg(not(feature = "diagnostics"))]
let recording = 0;
let get = |a: &std::sync::atomic::AtomicU64| a.load(Ordering::Relaxed);
Counters([
super::worked(),
@@ -128,7 +133,7 @@ impl Counters {
get(&COPY_BACK[1]),
get(&crate::shadow::CARD_STATS[0]),
crate::draw::dropped_now(),
peek(C::RecordNs),
recording,
crate::draw::drawn(),
])
}
@@ -144,19 +149,47 @@ impl Counters {
}
}
/// The process's memory in bytes: in physical memory, and committed
/// (private bytes).
fn process_memory() -> (u64, u64) {
use windows_sys::Win32::System::ProcessStatus::{K32GetProcessMemoryInfo, PROCESS_MEMORY_COUNTERS};
use windows_sys::Win32::System::Threading::GetCurrentProcess;
let mut c = PROCESS_MEMORY_COUNTERS {
cb: size_of::<PROCESS_MEMORY_COUNTERS>() as u32,
..Default::default()
};
// SAFETY: our own process and a sized structure.
unsafe { K32GetProcessMemoryInfo(GetCurrentProcess(), &mut c, c.cb) };
(c.WorkingSetSize as u64, c.PagefileUsage as u64)
}
/// The frame generation line: `per` frames shown for each one rendered.
fn generated(fps: f64, per: u32) -> String {
match per {
0 | 1 => "FRAME GEN OFF".to_owned(),
per => format!("FRAME GEN {per}X SHOWN {:.1} FPS", fps * f64::from(per)),
}
}
/// The text. `c`: [`Counters`] per frame, `ms` a frame's time, `worst` the
/// longest frame's, `cost` what this takes of a frame, in microseconds.
fn text(c: &[f64; COUNTERS], ms: f64, worst: f64, cost: f64, host: &Host) -> Vec<String> {
let gb = |bytes: u64| bytes as f64 / (1u64 << 30) as f64;
let (working, private) = crate::copystat::process_memory();
let (working, private) = process_memory();
let [budget, used, _, shared] = host.video_memory().unwrap_or_default();
let idle = (c[1] / 1e3).min(ms);
let fps = 1e3 / ms.max(0.001);
vec![
format!("FPS {:.1} FRAME {ms:.1} MS LONGEST {worst:.0}", 1e3 / ms.max(0.001)),
format!("FPS {fps:.1} FRAME {ms:.1} MS LONGEST {worst:.0}"),
generated(fps, crate::streamline::shown_per_frame()),
format!("DRAWS {:.0} DROPPED {:.0}", c[10], c[8]),
format!("SUBMIT BUSY {:.1} WAITS FOR GPU {:.1}", c[0] / 1e3, c[3] / 1e3),
format!("GPU BUSY {:.1} IDLE BEHIND US {:.1}", ms - idle, c[2] / 1e3),
format!("RECORDING {:.0} MS COPY BACK {:.1}", c[9] / 1e6, c[5] / 1e3),
if cfg!(feature = "diagnostics") {
format!("RECORDING {:.0} MS COPY BACK {:.1}", c[9] / 1e6, c[5] / 1e3)
} else {
format!("COPY BACK {:.1} MS", c[5] / 1e3)
},
format!("MB UP {:.0} TEXTURES {:.0} BACK {:.0}", c[7] / 1e6, c[4] / 1e6, c[6] / 1e6),
format!("RAM {:.1} GB IN MEMORY {:.1}", gb(private), gb(working)),
format!("VRAM {:.1}/{:.1} GB SHARED {:.1}", gb(used), gb(budget), gb(shared)),
@@ -302,6 +335,7 @@ impl Panel {
}
let began = Instant::now();
// Not the title's: the frame recorder leaves it out.
#[cfg(feature = "diagnostics")]
let _ours = crate::replay::record::unrecorded();
let scale = scale(height);
if self.buffers.as_ref().is_none_or(|b| (b.format, b.scale) != (format, scale)) {
@@ -380,6 +414,14 @@ mod tests {
}
}
/// The frame generation line fits the box and says what is shown.
#[test]
fn generated_frames_are_told() {
assert_eq!(generated(27.5, 1), "FRAME GEN OFF");
assert_eq!(generated(27.5, 6), "FRAME GEN 6X SHOWN 165.0 FPS");
assert!(generated(999.9, 6).len() <= COLUMNS as usize);
}
#[test]
fn a_box_is_painted() {
let lines = vec!["I".to_owned(), " i".to_owned()];