Water light on, PS4 pads, F1 menu saves at once, long-session memory, memory switches

Rendering and memory (GPL-3.0 code ported in; credits in the source):
- Water: 64-lane compute programs on 32-lane waves keep each wave
  together through loops and set up shared memory from the first
  thread, so the water's tiled light no longer leaves dark blocks. It
  runs by default now (VICTORY_WATER_LIGHT=0 leaves it out; an empty
  value, an earlier version's saved OFF, runs it). Also cloud tiles and
  the screen probes' ray activation.
- Placed views: their padding cleared as before; folding a buffer
  view's first element into its address is VICTORY_PLACED_FOLD=1, off:
  with it on, clothing and caps swapped to other variants for single
  frames in the boat cutscene.
- Texture sweep: textures whose copy was let go leave the looks until
  used again. Static samplers made first, in one order. Small buffers
  made ahead of the first 3D frame.
- play mode: VICTORY_TEXSPK_PASS_MS=8, VICTORY_PASSES_HOT=1,
  VICTORY_HELPER_PRIORITY=1.
- Memory switches, all off: VICTORY_SLOT_EVICT, VICTORY_ALLOCATOR_TRIM,
  VICTORY_BUDGET_PACK (and VICTORY_LIST_POOL_IDLE_S).

Input: DualShock 4 (0x05C4, 0x09CC, 0x0BA0 adapter) read over HID, USB
and Bluetooth, beside the DualSense; PlayStation pads rumble, and stop
when the game ends (issue #352).

F1 menu: every change is saved at once; it saves to
victory-settings.txt in VICTORY_HOME or %LOCALAPPDATA%\victory however
the game was started (no more "NO SETTINGS FILE").

Warm-up start: its 30 s count from the first frame of 100 draws or
more, not from the start: waiting at the title screen restarted it too
early and the next run still sat at 14 fps.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
trustno1-coderandClaude Opus 5.5 committed 2026-11-27 15:03:27 -08:00
1 parent df2daafeb1
commit 64d4931b3d
44 files changed
+4664 -952

No files matched your search

+25 -1
View File
@@ -357,6 +357,9 @@ fn big(at: *mut u8, size: usize, made: bool) {
if size < BIG {
return;
}
if made && size >= 64 << 20 {
name_big(size);
}
for (place, bytes) in BIG_AT.iter().zip(&BIG_BYTES) {
if made {
if place.compare_exchange(0, at as usize, Relaxed, Relaxed).is_ok() {
@@ -371,6 +374,26 @@ fn big(at: *mut u8, size: usize, made: bool) {
}
}
thread_local! {
/// Set while [`name_big`] logs: what it allocates is not named again.
static NAMING_BIG: std::cell::Cell<bool> = const { std::cell::Cell::new(false) };
}
/// Logs where a block of ours of 64 MB or more is made, for the first 24:
/// the memory census lists their sizes alone (one of 401 MB in run leak3).
fn name_big(size: usize) {
if NAMING_BIG.with(|n| n.replace(true)) {
return;
}
static NAMED: AtomicU64 = AtomicU64::new(0);
if NAMED.fetch_add(1, Relaxed) < 24 {
let trace = std::backtrace::Backtrace::force_capture();
tracing::info!(mb = size >> 20, "a block of ours of 64 MB or more made:
{trace}");
}
NAMING_BIG.with(|n| n.set(false));
}
/// The sizes of our own big blocks alive, largest first, in MB.
fn big_blocks() -> String {
let mut sizes: Vec<u64> = BIG_BYTES.iter().map(|b| b.load(Relaxed)).filter(|&b| b != 0).collect();
@@ -900,7 +923,7 @@ fn log_memory() {
"memory, more: views named whole in their records since the start: {} constant buffer \
views, {} views of placed memory; of the view table's entries {} are constant buffer \
views and {} views of placed memory; shapes of placed views kept: {}; host lists: {} \
made by the host, {} preludes made for them, private bytes grew {:.0} MB while \
made by the host, {} preludes made for them ({} alive), private bytes grew {:.0} MB while \
lists were made; twins of depth textures: {:.0} MB; host copies of \
placed textures whose title memory is not mapped any more (estimate): {:.0} MB, of \
them still shown by a descriptor slot {:.0} MB; the pipeline library's mapped file \
@@ -912,6 +935,7 @@ fn log_memory() {
views[5],
lists[0],
lists[1],
crate::host::PRELUDES_ALIVE.load(Relaxed),
lists[2] as i64 as f64 / (1 << 20) as f64,
mb(census[7]),
mb(census[8]),