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 -3
View File
@@ -629,16 +629,38 @@ fn scheduler() -> Option<&'static Scheduler> {
})
.as_ref()?;
STARTED.call_once(|| {
let workers = std::thread::available_parallelism().map_or(4, |n| n.get());
// As many workers as processors (`VICTORY_DSTORAGE_WORKERS=<n>`: that many), below
// normal priority (`VICTORY_DSTORAGE_PRIORITY=<-2..2>`, 0: normal, as before
// 2026-11-27). While a scene streams in, all of them unpack at once: in a crowded
// cutscene (timeline tl5, 176 s into a new game, 62 ms a frame) 16 workers ran 10 ms
// a frame each beside 8 listing threads of 20 ms, and the threads a frame waits for
// stood "woken, not running yet" for 9.5 ms of each frame's chain. Below them in
// priority the workers take the processors nobody of the frame wants. The process
// runs above normal (`runtime::ahead_of_other_programs`), so they still come before
// other programs' threads.
let number = |name: &str| std::env::var(name).ok().and_then(|v| v.trim().parse::<i32>().ok());
let workers = match number("VICTORY_DSTORAGE_WORKERS") {
Some(n) if n > 0 => n as usize,
_ => std::thread::available_parallelism().map_or(4, |n| n.get()),
};
let priority = number("VICTORY_DSTORAGE_PRIORITY").map_or(-1, |p| p.clamp(-2, 2));
let started = (0..workers)
.filter(|i| {
std::thread::Builder::new()
.name(format!("dstorage {i}"))
.spawn(|| work(scheduler))
.spawn(move || {
#[cfg(windows)]
if priority != 0 {
use windows_sys::Win32::System::Threading::{GetCurrentThread, SetThreadPriority};
// SAFETY: this thread's own priority.
unsafe { SetThreadPriority(GetCurrentThread(), priority) };
}
work(scheduler)
})
.is_ok()
})
.count();
tracing::info!(workers = started, "dstorage: workers");
tracing::info!(workers = started, priority, "dstorage: workers (VICTORY_DSTORAGE_WORKERS, VICTORY_DSTORAGE_PRIORITY)");
});
Some(scheduler)
}