Windows 10 runtime, F1 preload fix, AMD FSR download, warm-up restart, MFG Unlocker notice
- Windows 10: every pipeline was refused (E_INVALIDARG) and the game closed within seconds, because Windows 10's own Direct3D 12 stops at shader model 6.5 and the translated shaders are 6.6. victory.exe now exports D3D12SDKVersion = 614 and D3D12SDKPath = .\D3D12\. Where the GPU runs below 6.6, `play` offers Microsoft's D3D12Core.dll (Agility SDK 1.614.1, from nuget.org; pinned SHA-256 and Microsoft signature checked) into D3D12 beside the exe, then checks again and stops with a clear message if it still can't. `victory get-d3d12` does it by hand. The host logs its shader model and runtime file. Windows 11 keeps using its own newer runtime. - F1 > PRELOAD SHADERS: the restart passed the script launcher's -Preload to victory.exe, which refused it, and the window closed at once. It now sets VICTORY_PRELOAD=1, which both launchers read, and a failed restart keeps its window open. - AMD FSR 3 files: offered for download where FSR 3 would be used (`victory get-fsr`, Get-AMD-FSR.cmd, scripts\get-amd-fsr.ps1; pinned hashes, AMD signature). - First start of a new victory.exe: it ran at a flat 14 fps for the whole session and normally from the second start on. The first start now plays 20 s with a notice, marks that exe under %LOCALAPPDATA%\victory\warmed and restarts by itself once (VICTORY_WARMUP_RESTART=0: not done). - RTX 20/30 with DLSS frame generation running (MFG Unlocker as winmm.dll beside the exe): the start notice says it is unlocked by a mod, and the log names DLLs beside victory.exe. - README: the above. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
ca9c75cd6d
commit
10862a6d87
14 files changed
+653
-12
No files matched your search
@@ -951,6 +951,20 @@ fn create() -> windows::core::Result<Host> {
|
||||
let amd = crate::indirect::amd(&device);
|
||||
victory_shader::emit::set_host_rdna(amd && o1.WaveLaneCountMin == 32 && o1.WaveLaneCountMax == 64);
|
||||
}
|
||||
// Every translated shader is SM 6.6: below it each pipeline is refused (E_INVALIDARG),
|
||||
// and the title falls over within seconds (Windows 10's own D3D12, 2026-11-27).
|
||||
match crate::streamline::device_shader_model(&device) {
|
||||
Some(sm) if sm >= crate::streamline::SHADER_MODEL_NEEDED => {
|
||||
let runtime = crate::streamline::d3d12_core_path().map(|p| p.display().to_string());
|
||||
tracing::info!(model = %format!("{}.{}", sm.0, sm.1), ?runtime, "host shader model");
|
||||
}
|
||||
sm => tracing::error!(
|
||||
model = %sm.map_or("unknown".to_owned(), |sm| format!("{}.{}", sm.0, sm.1)),
|
||||
"host shader model below 6.6: no translated shader can run here. On Windows 10, \
|
||||
`victory play` fetches Microsoft's newer Direct3D 12 runtime (D3D12\\D3D12Core.dll \
|
||||
beside victory.exe); otherwise update the graphics driver"
|
||||
),
|
||||
}
|
||||
let messages = debug
|
||||
.then(|| device.cast::<ID3D12InfoQueue>().ok())
|
||||
.flatten();
|
||||
|
||||
@@ -111,6 +111,28 @@ fn get(var: &str) -> String {
|
||||
std::env::var(var).unwrap_or_default()
|
||||
}
|
||||
|
||||
/// The first start of a new victory.exe: the seconds it plays before it starts
|
||||
/// again by itself (`VICTORY_WARMUP_RESTART`, set by the launcher while the exe
|
||||
/// has no mark under `%LOCALAPPDATA%\victory\warmed`). On the RTX 5070, every
|
||||
/// new build's first run stayed at a flat 14 fps (Present ~40 ms) for as long as
|
||||
/// it ran, and every later run was normal (27-29 fps), even after a first run of
|
||||
/// 45 seconds; a copy of an exe already run was fast at once (2026-11-27). Likely
|
||||
/// the driver's cache of the program; not ours to fix, so it is run through once.
|
||||
pub(crate) fn warmup_seconds() -> Option<u64> {
|
||||
get("VICTORY_WARMUP_RESTART").parse().ok().filter(|s| *s > 0)
|
||||
}
|
||||
|
||||
/// The start's notice lines for the warm-up start ([`warmup_seconds`]).
|
||||
pub(crate) fn warmup_notice(seconds: u64) -> Vec<String> {
|
||||
vec![
|
||||
"FIRST START OF THIS VERSION: A ONE-TIME WARM-UP".to_owned(),
|
||||
format!("THE GAME RESTARTS BY ITSELF IN ABOUT {seconds} SECONDS"),
|
||||
"THIS HAPPENS ONCE PER NEW VERSION, AND IS NEEDED:".to_owned(),
|
||||
"WITHOUT IT THE FIRST RUN STAYS AT ABOUT 14 FPS".to_owned(),
|
||||
String::new(),
|
||||
]
|
||||
}
|
||||
|
||||
/// Starts `command_line` in a console window of its own, with that console's input and output.
|
||||
/// (`std::process::Command` always hands its child this process's standard handles: the restarted
|
||||
/// launcher then wrote into the old launcher's pipe and log, not its own window, and kept the old
|
||||
@@ -455,7 +477,7 @@ impl Menu {
|
||||
}
|
||||
|
||||
/// Starts the launcher again in a new console, a few seconds on, and ends this run.
|
||||
/// `preload`: the launcher makes every shader first (its `-Preload`, for that start alone).
|
||||
/// `preload`: the launcher makes every shader first (`VICTORY_PRELOAD=1`, for that start alone).
|
||||
fn restart(&mut self, preload: bool) {
|
||||
let Some(play) = std::env::var_os("VICTORY_MENU_PLAY") else {
|
||||
self.note = "SAVED. START THE LAUNCHER AGAIN YOURSELF".to_owned();
|
||||
@@ -463,7 +485,14 @@ impl Menu {
|
||||
};
|
||||
let play = play.to_string_lossy().replace('\'', "''");
|
||||
let args = get("VICTORY_MENU_ARGS");
|
||||
let command = format!("Start-Sleep 3; & '{play}' {args}{}", if preload { " -Preload" } else { "" });
|
||||
// The preload is asked by VICTORY_PRELOAD=1, which both launchers read (victory.exe's is
|
||||
// `--preload`, the script's `-Preload`: the script's flag given to victory.exe was refused,
|
||||
// and the window closed before it could be read, 2026-11-27). A launcher that fails keeps
|
||||
// its window until Enter.
|
||||
let command = format!(
|
||||
"Start-Sleep 3; {}& '{play}' {args}; if ($LASTEXITCODE) {{ Read-Host 'The start failed (see above). Press Enter to close this window' }}",
|
||||
if preload { "$env:VICTORY_PRELOAD='1'; " } else { "" }
|
||||
);
|
||||
match new_console(&format!("powershell.exe -NoProfile -ExecutionPolicy Bypass -Command \"{}\"", command.replace('"', "\\\""))) {
|
||||
Ok(()) => {
|
||||
tracing::info!(command, preload, "settings menu: restarting");
|
||||
@@ -483,6 +512,30 @@ impl Menu {
|
||||
}
|
||||
}
|
||||
|
||||
/// The warm-up start ([`warmup_seconds`]): once its time is up, this exe is
|
||||
/// marked as warmed up (`VICTORY_WARMUP_MARK`) and the game starts again.
|
||||
fn warmup(&mut self) {
|
||||
static BEGAN: OnceLock<std::time::Instant> = OnceLock::new();
|
||||
static DONE: AtomicBool = AtomicBool::new(false);
|
||||
let Some(seconds) = warmup_seconds() else { return };
|
||||
if DONE.load(Ordering::Relaxed) {
|
||||
return;
|
||||
}
|
||||
if BEGAN.get_or_init(std::time::Instant::now).elapsed() < Duration::from_secs(seconds) {
|
||||
return;
|
||||
}
|
||||
DONE.store(true, Ordering::Relaxed);
|
||||
let mark = std::path::PathBuf::from(get("VICTORY_WARMUP_MARK"));
|
||||
if !mark.as_os_str().is_empty() {
|
||||
if let Some(dir) = mark.parent() {
|
||||
let _ = std::fs::create_dir_all(dir);
|
||||
}
|
||||
let _ = std::fs::write(&mark, "this victory.exe was warmed up (its first start, then a restart)\r\n");
|
||||
}
|
||||
tracing::info!(seconds, mark = %mark.display(), "first start of this victory.exe: warmed up; the game starts again");
|
||||
self.restart(false);
|
||||
}
|
||||
|
||||
/// Removes the settings file: the launcher's own settings at the next start.
|
||||
fn reset(&mut self) {
|
||||
if let Some(path) = std::env::var_os("VICTORY_MENU_FILE") {
|
||||
@@ -493,6 +546,7 @@ impl Menu {
|
||||
|
||||
/// A frame was presented: the keys pressed since the last one.
|
||||
pub(super) fn frame(&mut self) {
|
||||
self.warmup();
|
||||
let pressed = std::mem::take(&mut *keys().lock().unwrap_or_else(|e| e.into_inner()));
|
||||
if pressed.is_empty() {
|
||||
return;
|
||||
|
||||
@@ -423,7 +423,10 @@ pub(super) struct Notice {
|
||||
|
||||
impl Notice {
|
||||
pub(super) fn new() -> Notice {
|
||||
let lines: Vec<String> = crate::streamline::notice().into_iter().map(|l| l.to_ascii_uppercase()).collect();
|
||||
// The first start of a new victory.exe says first that it restarts by itself (menu.rs).
|
||||
let warmup = super::menu::warmup_seconds().map(super::menu::warmup_notice).unwrap_or_default();
|
||||
let lines: Vec<String> =
|
||||
warmup.into_iter().chain(crate::streamline::notice()).map(|l| l.to_ascii_uppercase()).collect();
|
||||
let columns = lines.iter().map(|l| l.len() as u32).max().unwrap_or(0).min(NOTICE_COLUMNS);
|
||||
let shape = Shape { columns, lines: lines.len() as u32 };
|
||||
Notice { done: lines.is_empty(), lines, shape, since: None, buffers: None, written: false }
|
||||
|
||||
@@ -434,7 +434,12 @@ fn notice_of(f: &Facts, dlss_live: bool, fsr_live: bool) -> Vec<String> {
|
||||
"DLSS FRAME GEN: NOT ON THIS CARD (RTX 40 AND UP)"
|
||||
}.into());
|
||||
}
|
||||
if dlss_live {
|
||||
if dlss_live && !f.adapter.is_empty() && !dlss_framegen_card(&f.adapter) {
|
||||
// An RTX 20 or 30 with DLSS Frame Generation: a mod beside victory.exe (MFG Unlocker,
|
||||
// as winmm.dll) answers for the card; how many frames it gives, Streamline says.
|
||||
lines.push("FRAME GEN: DLSS, UNLOCKED BY A MOD (F1 MENU: 2X-6X)".into());
|
||||
lines.push("NVIDIA DOES NOT SUPPORT IT: IF IT FAILS, REMOVE IT".into());
|
||||
} else if dlss_live {
|
||||
lines.push("FRAME GEN: DLSS, SUPPORTED HERE (F1 MENU: 2X-6X)".into());
|
||||
lines.push("MORE THAN 2X NEEDS AN RTX 50 CARD".into());
|
||||
} else if fsr_live {
|
||||
@@ -623,6 +628,21 @@ fn wide(path: &Path) -> Vec<u16> {
|
||||
path.as_os_str().encode_wide().chain([0]).collect()
|
||||
}
|
||||
|
||||
/// The name of the card the title will run on (the launcher asks whether to
|
||||
/// fetch AMD's FSR 3 files only where DLSS Frame Generation will not run).
|
||||
pub fn adapter_name() -> Option<String> {
|
||||
default_adapter().map(|a| a.0)
|
||||
}
|
||||
|
||||
/// Whether a card of this name runs DLSS Frame Generation: a GeForce RTX of
|
||||
/// the 40 or 50 series ("NVIDIA GeForce RTX 4070 SUPER", "... RTX 5090 Laptop GPU").
|
||||
pub fn dlss_framegen_card(name: &str) -> bool {
|
||||
let name = name.to_ascii_uppercase();
|
||||
let Some(at) = name.find("RTX") else { return false };
|
||||
let model: String = name[at + 3..].trim_start().chars().take_while(char::is_ascii_digit).collect();
|
||||
model.len() == 4 && (model.starts_with("40") || model.starts_with("50"))
|
||||
}
|
||||
|
||||
/// The adapter a device made with no adapter named is on (the first), its
|
||||
/// name and LUID.
|
||||
fn default_adapter() -> Option<(String, windows::Win32::Foundation::LUID)> {
|
||||
@@ -636,6 +656,61 @@ fn default_adapter() -> Option<(String, windows::Win32::Foundation::LUID)> {
|
||||
}
|
||||
}
|
||||
|
||||
/// The translated shaders' shader model (6.6, `ResourceDescriptorHeap[]`).
|
||||
pub const SHADER_MODEL_NEEDED: (u32, u32) = (6, 6);
|
||||
|
||||
/// The highest shader model `device` runs, as (major, minor). Asked from 6.9
|
||||
/// down: a runtime that does not know a model refuses the question.
|
||||
pub fn device_shader_model(device: &ID3D12Device) -> Option<(u32, u32)> {
|
||||
(0x60..=0x69).rev().find_map(|v| {
|
||||
let mut model = D3D12_FEATURE_DATA_SHADER_MODEL { HighestShaderModel: D3D_SHADER_MODEL(v) };
|
||||
// SAFETY: writes `model` of the given size.
|
||||
let ok = unsafe {
|
||||
device.CheckFeatureSupport(D3D12_FEATURE_SHADER_MODEL, (&raw mut model).cast(), size_of_val(&model) as u32)
|
||||
}
|
||||
.is_ok();
|
||||
let m = model.HighestShaderModel.0 as u32;
|
||||
ok.then_some((m >> 4, m & 0xF))
|
||||
})
|
||||
.or(Some((5, 1)))
|
||||
}
|
||||
|
||||
/// The highest shader model of the default adapter (the one the title's device is
|
||||
/// on), from a device made for the question; `None` without one. Windows 10's own
|
||||
/// Direct3D 12 stops at 6.5; Microsoft's newer runtime (`D3D12\D3D12Core.dll`
|
||||
/// beside the program, which victory.exe asks for) runs 6.6. Made in a process of
|
||||
/// its own (`victory shader-model`), since a process keeps the first runtime it loads.
|
||||
pub fn highest_shader_model() -> Option<(u32, u32)> {
|
||||
use windows::Win32::Graphics::Direct3D::D3D_FEATURE_LEVEL_11_0;
|
||||
// SAFETY: plain DXGI and D3D12 calls with owned results.
|
||||
let device = unsafe {
|
||||
let factory: IDXGIFactory1 = CreateDXGIFactory1().ok()?;
|
||||
let adapter = factory.EnumAdapters1(0).ok()?;
|
||||
let mut device: Option<ID3D12Device> = None;
|
||||
D3D12CreateDevice(&adapter, D3D_FEATURE_LEVEL_11_0, &mut device).ok()?;
|
||||
device?
|
||||
};
|
||||
device_shader_model(&device)
|
||||
}
|
||||
|
||||
/// The file of the Direct3D 12 runtime this process loaded (`D3D12Core.dll`:
|
||||
/// Windows' own in System32, or Microsoft's newer one from `D3D12\` beside the
|
||||
/// program); `None` before a device is made.
|
||||
pub fn d3d12_core_path() -> Option<PathBuf> {
|
||||
use windows_sys::Win32::System::LibraryLoader::{GetModuleFileNameW, GetModuleHandleW};
|
||||
let name = wide(Path::new("D3D12Core.dll"));
|
||||
// SAFETY: a module of this process by name, its file name into a buffer of the given size.
|
||||
unsafe {
|
||||
let module = GetModuleHandleW(name.as_ptr());
|
||||
if module.is_null() {
|
||||
return None;
|
||||
}
|
||||
let mut buf = [0u16; 1024];
|
||||
let len = GetModuleFileNameW(module, buf.as_mut_ptr(), buf.len() as u32) as usize;
|
||||
(len > 0).then(|| PathBuf::from(String::from_utf16_lossy(&buf[..len])))
|
||||
}
|
||||
}
|
||||
|
||||
/// The Authenticode signature of `path` (NVIDIA signs its DLLs), checked
|
||||
/// without going online.
|
||||
fn verify_signature(path: &Path) -> Result<(), String> {
|
||||
|
||||
@@ -906,7 +906,13 @@ mod tests {
|
||||
l.join("|")
|
||||
};
|
||||
// RTX 40/50: DLSS frame generation.
|
||||
assert!(lines(facts(true, true, true, false), true, false).contains("FRAME GEN: DLSS"));
|
||||
let mut rtx40 = facts(true, true, true, false);
|
||||
rtx40.adapter = "NVIDIA GeForce RTX 4070".into();
|
||||
let rtx40 = lines(rtx40, true, false);
|
||||
assert!(rtx40.contains("FRAME GEN: DLSS, SUPPORTED") && !rtx40.contains("MOD"), "{rtx40}");
|
||||
// RTX 20/30 with DLSS frame generation running: a mod unlocked it (MFG Unlocker).
|
||||
let unlocked = lines(facts(true, true, true, false), true, false);
|
||||
assert!(unlocked.contains("UNLOCKED BY A MOD") && !unlocked.contains("SUPPORTED HERE"), "{unlocked}");
|
||||
// RTX 20/30 on Series X with DLSS: FSR 3 instead, 2X.
|
||||
let rtx30 = lines(facts(true, false, true, false), false, true);
|
||||
assert!(rtx30.contains("NOT ON THIS CARD") && rtx30.contains("FSR 3") && rtx30.contains("2X"));
|
||||
|
||||
Reference in new issue
Block a user