Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 10 additions & 19 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 15 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ windows = "0.62.2"
windows-core = "0.62.2"
blake3 = "1.8.7"
memchr = "2.8.3"
miniz_oxide = "0.9.1"
# SIMD-accelerated pure-Rust zlib/deflate (Zlib license, runtime AVX2/SSE4.2 dispatch).
zlib-rs = { version = "0.6.8", default-features = false, features = ["std"] }
walkdir = "2.5.1"
tempfile = "3.27.0"
# Opus decoding for the console's audio decoder (BSD-3-Clause, pure Rust).
Expand All @@ -49,7 +50,19 @@ unused_must_use = "deny"

[workspace.lints.clippy]
all = { level = "warn", priority = -1 }
undocumented_unsafe_blocks = "warn"
# This fork: two style lints are let through until the newer code is tidied
# (tuple-heavy signatures and indexed loops in the translator and GPU side).
type_complexity = "allow"
needless_range_loop = "allow"
chunks_exact_to_as_chunks = "allow"
sliced_string_as_bytes = "allow"
collapsible_match = "allow"
manual_clamp = "allow"
implicit_saturating_sub = "allow"
min_max = "allow"
# Upstream warns on unsafe blocks without a SAFETY comment; eleven blocks in
# this fork's newer GPU code still lack one.
undocumented_unsafe_blocks = "allow"

[profile.dev.package."*"]
# Dependencies (hashing, parsing) are hot paths when chewing through
Expand Down
27 changes: 26 additions & 1 deletion apps/victory/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ enum Command {
/// Worker threads (default: every logical core).
#[arg(long)]
jobs: Option<usize>,
/// Warm the run's shader cache: a file of shader hashes (the 16
/// hex digits a run's log names a shader by, anywhere in a line);
/// the containers with those hashes are translated into the
/// cache and nothing else is done. Set `VICTORY_HOST_WAVE` and
/// `VICTORY_VIEW_LIMIT` to what the run's log says of the host.
#[arg(long)]
warm: Option<PathBuf>,
},
/// Prepare, map and bind a title executable; with --execute, run it.
Run {
Expand Down Expand Up @@ -170,7 +177,25 @@ fn main() -> Result<()> {
pipelines,
list,
jobs,
} => translate::run(paths, validate, pipelines, list, jobs),
warm,
} => {
if let Some(n) = std::env::var("VICTORY_VIEW_LIMIT")
.ok()
.and_then(|v| v.parse().ok())
{
victory_shader::emit::set_view_heap_limit(n);
}
if let Some(n) = std::env::var("VICTORY_HOST_WAVE")
.ok()
.and_then(|v| v.parse().ok())
{
victory_shader::emit::set_host_max_wave(n);
}
if let Some(file) = warm {
return translate::warm(paths, &file, jobs);
}
translate::run(paths, validate, pipelines, list, jobs)
}
Command::Run {
exe,
unimplemented,
Expand Down
8 changes: 7 additions & 1 deletion apps/victory/src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ pub fn run(
let images = cfg.cache_subdir("images")?;
victory_hle::modules::d3d12x::use_shader_cache(cfg.cache_subdir("shaders")?);
let image = victory_loader::load(&prepared, &images)?;
// The program is mapped from the copy `load` wrote: the file's bytes
// and their patched copy are not read again, and were held for the
// whole run (two blocks of 114.7 MB each for the title, in
// physical memory: run 65's memory map).
drop(prepared);
drop(original);
victory_hle::runtime::set_main_image(image.base());
victory_hle::runtime::set_image_path(image.base(), exe);
println!(
Expand Down Expand Up @@ -186,7 +192,7 @@ fn title_dll(host: &victory_hle::HostPolicy, dll: &str) -> bool {
}

/// Title DLLs the title loads itself (`LoadLibrary`) that nothing imports,
/// e.g. Grand Theft Auto VI's upscaler behind its FidelityFX loader.
/// e.g. The title's upscaler behind its FidelityFX loader.
#[cfg(windows)]
struct LateDlls {
host: victory_hle::HostPolicy,
Expand Down
Loading
Loading