Save sharing in the F1 menu, restarts keep their options, DLSS fixes, monitor's card

- F1 EXPORT SAVE writes the save as one zip into the game folder's Saves
  folder; IMPORT SAVE lists the zips there to pick from. An import is put
  in place at the next start, and the save there before is zipped first
  ("backup before import ..."). Zips made by hand are taken too: with a
  folder around the save, or starting inside the saves folder. The game's
  own settings (SettingsProfileSettings) are never exported or imported:
  the player keeps theirs.
- A restart from the F1 menu keeps the options the game was started with
  (#197).
- DLSS picked in the F1 menu fetches NVIDIA's files at the next start,
  even after an earlier "no", and the menu says so (#514).
- When the driver refuses nearly every DLSS upscaling, DLSS and frame
  generation are turned off for the run.
- FSR 3 frame generation is made ready only with DLSS upscaling on: the
  title's own FidelityFX check stopped the game otherwise (#331, #459).
- RTX Ada, Blackwell and RTX PRO workstation cards count as cards with
  DLSS frame generation.
- On a PC with two cards the game plays on the card the monitor is on, and
  the preload's pipelines are kept per card.
- The warm-up restart comes after 10 seconds.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-authored-by: DueTonight <[email protected]>
Co-authored-by: mikan123pro <[email protected]>
This commit is contained in:
committed 2026-11-27 16:58:02 -08:00
1 parent 64d4931b3d
commit c1cbdc9d11
10 files changed
+1191 -61

No files matched your search

+106 -21
View File
@@ -316,7 +316,10 @@ fn settings(o: &Play, menu: &[(String, String)], streamline: Option<&Path>) -> (
// AMD FSR 3 frame generation, made ready as DLSS frame generation is: auto, the layer uses
// it only where DLSS frame generation does not run; fsr, DLSS frame generation is not asked.
// The layer checks the files and the card and says at the start what runs and why not.
if fg_type != "dlss" && (framegen || !o.no_framegen_ready) {
// Only with DLSS on: it never runs without DLSS's upscaling, and made ready without it (the
// title's FidelityFX then left with AMD's files) the title stopped during the boot screens
// (0x80000003 at +0x2219650, or exit code 3; #331, #459: --no-framegen-ready avoided it).
if dlss_on && fg_type != "dlss" && (framegen || !o.no_framegen_ready) {
set("VICTORY_FSR_FRAMEGEN", "1");
if fg_type == "fsr" {
s.remove("VICTORY_FRAMEGEN");
@@ -420,8 +423,21 @@ pub(crate) fn get_dlss() -> Result<()> {
}
/// Asks once, at a start without NVIDIA's files, whether to fetch them.
fn offer_dlss() {
/// `picked`: DLSS was turned on in the F1 menu, which says they are fetched at
/// the next start: they are, without asking, also after an earlier "no"
/// (players who said no and later picked DLSS in F1 saw it turn off again at
/// every start, #514).
fn offer_dlss(picked: bool) {
let Ok(to) = nvidia_home() else { return };
if picked {
println!("DLSS was picked in the F1 menu: fetching NVIDIA's DLSS and frame generation files from");
println!("github.com/NVIDIA-RTX/Streamline (NVIDIA's own, under NVIDIA's licences; about 70 MB, once).");
let _ = std::fs::remove_file(to.join("declined"));
if let Err(e) = fetch(&to) {
println!("{e:#}");
}
return;
}
let declined = to.join("declined");
if declined.exists() || !std::io::stdin().is_terminal() {
println!("No NVIDIA files: running without DLSS and frame generation (`victory get-dlss` fetches them).");
@@ -752,8 +768,9 @@ fn mod_dlls(here: &Path) -> Vec<String> {
NAMES.iter().filter(|n| here.join(n).is_file()).map(|n| (*n).to_owned()).collect()
}
/// How long the first start of a new victory.exe plays before it restarts.
const WARMUP_SECONDS: u32 = 30;
/// How long the first start of a new victory.exe plays before it restarts,
/// counted from the first frame of the game's world (100 draws or more).
const WARMUP_SECONDS: u32 = 10;
/// The file that says this victory.exe (its bytes) had its warm-up start:
/// `%LOCALAPPDATA%\victory\warmed\<hash>`. `None`: the exe could not be read.
@@ -796,14 +813,9 @@ pub(crate) fn prepare(o: &Play) -> Result<Ready> {
std::fs::create_dir_all(&home).with_context(|| format!("creating {}", home.display()))?;
let menu_file = home.join("victory-settings.txt");
let menu = parse_menu(&std::fs::read_to_string(&menu_file).unwrap_or_default());
let wants_dlss = menu
.iter()
.rev()
.find(|(k, _)| k == "VICTORY_MENU_DLSS")
.map_or(o.dlss.as_str(), |(_, v)| v.as_str())
!= "off";
if wants_dlss && streamline_dir(&here).is_none() {
offer_dlss();
let picked = menu.iter().rev().find(|(k, _)| k == "VICTORY_MENU_DLSS").map(|(_, v)| v.as_str());
if picked.unwrap_or(o.dlss.as_str()) != "off" && streamline_dir(&here).is_none() {
offer_dlss(picked.is_some_and(|d| DLSS_MODES.contains(&d)));
}
let streamline = streamline_dir(&here);
let (mut s, series_s) = settings(o, &menu, streamline.as_deref());
@@ -850,14 +862,10 @@ pub(crate) fn prepare(o: &Play) -> Result<Ready> {
s.insert("VICTORY_WARMUP_RESTART".to_owned(), WARMUP_SECONDS.to_string());
s.insert("VICTORY_WARMUP_MARK".to_owned(), mark.to_string_lossy().into_owned());
}
// Where the menu saves, and how it starts the title again (`--set` is not carried over).
let quoted = |p: &Path| format!("'{}'", p.to_string_lossy().replace('\'', "''"));
// Where the menu saves, and how it starts the title again: with this start's options.
s.insert("VICTORY_MENU_FILE".to_owned(), menu_file.to_string_lossy().into_owned());
s.insert("VICTORY_MENU_PLAY".to_owned(), program.to_string_lossy().into_owned());
s.insert(
"VICTORY_MENU_ARGS".to_owned(),
format!("play {}{}", quoted(&exe), if o.no_framegen_ready { " --no-framegen-ready" } else { "" }),
);
s.insert("VICTORY_MENU_ARGS".to_owned(), restart_args(o, &exe));
let log = log_file(&home.join("logs"))?;
let console = if series_s { "series-s" } else { "series-x" };
let line: Vec<String> = s.iter().map(|(k, v)| format!("{k}={v}")).collect();
@@ -888,6 +896,35 @@ pub(crate) fn prepare(o: &Play) -> Result<Ready> {
Ok(Ready { exe, series_s })
}
/// A PowerShell word holding `text` as it is.
fn quoted(text: &str) -> String {
format!("'{}'", text.replace('\'', "''"))
}
/// The arguments the warm-up and the F1 menu's restarts start the title
/// again with (`VICTORY_MENU_ARGS`, after `& '<victory.exe>'` in PowerShell):
/// this start's own options, so those given on the command line (`--series-s`,
/// `--dlss`, `--framegen`, `--set` ...) are kept. Values saved in the F1 menu
/// still win over them, as at every start. A preload is not asked again.
fn restart_args(o: &Play, exe: &Path) -> String {
let mut args = vec!["play".to_owned(), quoted(&exe.to_string_lossy())];
if o.series_s {
args.push("--series-s".to_owned());
}
args.extend(["--res".to_owned(), quoted(&o.res), "--dlss".to_owned(), quoted(&o.dlss)]);
if let Some(x) = o.framegen {
args.extend(["--framegen".to_owned(), x.to_string()]);
}
if o.no_framegen_ready {
args.push("--no-framegen-ready".to_owned());
}
args.extend(["--fg-type".to_owned(), quoted(&o.fg_type), "--fps".to_owned(), o.fps.to_string()]);
for more in &o.more {
args.extend(["--set".to_owned(), quoted(more)]);
}
args.join(" ")
}
/// After a start that went wrong in a window of its own (a double click):
/// the text stays until a key is pressed.
pub(crate) fn hold_window() {
@@ -917,6 +954,51 @@ mod tests {
}
}
#[test]
fn a_restart_keeps_the_options_of_the_command_line() {
use clap::Parser;
#[derive(clap::Parser)]
struct Line {
#[command(flatten)]
play: Play,
}
let exe = Path::new(r"C:\Games\GTA VI's\game_scarlett_master.exe");
let first = [
"x", "--series-s", "--dlss", "performance", "--framegen", "2", "--fg-type", "dlss", "--set", "VICTORY_MFG_UNLOCKER=1", "--set",
"VICTORY_X=a b", "--preload",
];
let o = Line::try_parse_from(first).unwrap().play;
let args = restart_args(&o, exe);
assert_eq!(
args,
r"play 'C:\Games\GTA VI''s\game_scarlett_master.exe' --series-s --res '1440' --dlss 'performance' --framegen 2 --fg-type 'dlss' --fps 1000 --set 'VICTORY_MFG_UNLOCKER=1' --set 'VICTORY_X=a b'"
);
// Read back as PowerShell reads it: the same options again, and no preload.
let mut words: Vec<String> = Vec::new();
let (mut word, mut open, mut chars) = (String::new(), false, args.chars().peekable());
while let Some(c) = chars.next() {
match c {
'\'' if open && chars.peek() == Some(&'\'') => {
word.push('\'');
chars.next();
}
'\'' => open = !open,
' ' if !open => words.push(std::mem::take(&mut word)),
_ => word.push(c),
}
}
words.push(word);
assert_eq!(words[1], exe.to_string_lossy());
let again = Line::try_parse_from(std::iter::once("x".to_owned()).chain(words.into_iter().skip(2))).unwrap().play;
assert_eq!(restart_args(&again, exe), args);
assert!(o.preload && !again.preload);
let plain = Line::try_parse_from(["x"]).unwrap().play;
assert_eq!(
restart_args(&plain, exe),
r"play 'C:\Games\GTA VI''s\game_scarlett_master.exe' --res '1440' --dlss 'quality' --fg-type 'auto' --fps 1000"
);
}
#[test]
fn a_plain_start_is_the_launchers() {
let dir = Path::new(r"C:\nvidia");
@@ -943,9 +1025,9 @@ mod tests {
let get = |k: &str| s.get(k).map(String::as_str);
assert!(!s.contains_key("VICTORY_DLSS") && !s.contains_key("VICTORY_FRAMEGEN"));
assert_eq!(get("VICTORY_MENU_DLSS"), Some("off"));
// FSR 3 frame generation is made ready instead (the layer says whether it can run)
assert_eq!((get("VICTORY_FSR_FRAMEGEN"), get("VICTORY_FRAMEGEN_X")), (Some("1"), Some("0")));
assert_eq!(get("VICTORY_TEXTURE_ROOM_PERCENT"), Some("86"));
// nor FSR 3 frame generation: made ready without DLSS, the title's own FidelityFX
// check stopped the game (#331, #459)
assert!(!s.contains_key("VICTORY_FSR_FRAMEGEN") && !s.contains_key("VICTORY_FRAMEGEN_X"));
assert_eq!(get("VICTORY_MENU_FG_TYPE"), Some("auto"));
}
@@ -1007,6 +1089,9 @@ mod tests {
assert!(fg("NVIDIA GeForce RTX 5070") && fg("NVIDIA GeForce RTX 4070 SUPER") && fg("NVIDIA GeForce RTX 5090 Laptop GPU"));
assert!(!fg("NVIDIA GeForce RTX 3080 Ti") && !fg("NVIDIA GeForce RTX 2060") && !fg("NVIDIA GeForce GTX 1080"));
assert!(!fg("AMD Radeon RX 7900 XTX") && !fg("Intel(R) Arc(TM) A770 Graphics") && !fg(""));
// Workstation cards (#312): Ada and Blackwell have it, Turing and Ampere not.
assert!(fg("NVIDIA RTX PRO 4000 Blackwell SFF Edition") && fg("NVIDIA RTX 2000 Ada Generation") && fg("NVIDIA RTX 6000 Ada Generation"));
assert!(!fg("Quadro RTX 5000") && !fg("NVIDIA Quadro RTX 4000") && !fg("NVIDIA RTX A4500") && !fg("NVIDIA RTX A2000 12GB"));
}
/// MFG Unlocker is offered only to RTX 20 and 30 cards.
+6
View File
@@ -249,6 +249,12 @@ pub fn run(
victory_hle::modules::files::mount_at('G', title_dir);
let temp = cfg.data_subdir(&format!("{:08X}/temp", title.id))?;
victory_hle::modules::files::mount_at('T', &temp);
// The F1 menu's save sharing, and an import it staged put in place before the title runs.
if let Some(data) = storage.parent()
&& let Some(line) = victory_hle::save_share::start(data, title_dir)
{
println!("saves {line}");
}
victory_hle::runtime::set_title(victory_hle::runtime::Title { storage, ..title });
victory_hle::console::set(match console {
Console::SeriesX => victory_hle::console::Console::SeriesX,
+10 -4
View File
@@ -35,15 +35,21 @@ pub fn run(jobs: Option<usize>, limit: Option<usize>, again: bool, used: bool, t
// (A first preload on a PC no run has written pipelines down on yet: none known.)
std::fs::create_dir_all(&dir).with_context(|| format!("creating {}", dir.display()))?;
victory_hle::known_pipelines::use_translations(dir.with_file_name("shaders"));
// The driver keeps what is made here by program path: made by another copy of
// this program, a pipeline is not made for this one.
// The driver keeps what is made here by program path and card: made by
// another copy of this program, or on the other card of a PC with two, a
// pipeline is not made for this one (v2026.11.27.8 made them all on an RTX
// 5060 Ti while the runs played on the RTX 5070 beside it: black parts in
// the picture where the 5070 had not made a pipeline yet).
let fingerprint = {
let program = std::env::current_exe().map(|p| p.to_string_lossy().to_lowercase()).unwrap_or_default();
let card = victory_shader::emit::host::hardware_adapter().map(|(_, name, _)| name).unwrap_or_default();
let mut h = blake3::Hasher::new();
h.update(known::fingerprint().as_bytes());
h.update(program.as_bytes());
h.finalize().to_hex()[..16].to_owned()
h.update(card.as_bytes());
(h.finalize().to_hex()[..16].to_owned(), card)
};
let (fingerprint, card) = fingerprint;
let done_file = dir.join("warm-done.txt");
let bad_file = dir.join("warm-bad.txt");
let keys = known::keys(&dir);
@@ -72,7 +78,7 @@ pub fn run(jobs: Option<usize>, limit: Option<usize>, again: bool, used: bool, t
let cores = std::thread::available_parallelism().map_or(4, |n| n.get());
let jobs = jobs.unwrap_or(cores * 2 / 3).max(1);
println!(
"{} pipelines known, {} made before ({fingerprint}), {} bad; {} to make, {jobs} processes",
"{} pipelines known, {} made before ({fingerprint}, on {card}), {} bad; {} to make, {jobs} processes",
keys.len(),
done.len(),
bad.len(),