Repository navigation
[BUNDLE] Eight more fixes carried from contributors' forks: #745 #776 #787 #805 #845 #852 #915 #918 - #1610
[BUNDLE] Eight more fixes carried from contributors' forks: #745 #776 #787 #805 #845 #852 #915 #918#1610MamaLeVrai wants to merge 20 commits into
Conversation
…fcmp uno) v_med3_f32 and v_med3_f16 return the least operand when one is NaN, which `med3` chose with `fcmp uno`. NVIDIA's driver assumes no NaNs in that compare and folds it to false, so the NaN case gave the plain median: v_med3_f32_matches_rdna2_with_nan failed on an RTX 3050 Ti (`v_med3_f32(1.0, 2.0, NaN) = 2`, want 1). An integer test of the bits (|x| > +inf) cannot be folded that way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Nested buffers in the world (several views into one 174 MB block) each asked GetWriteWatch about largely the same pages, about 20 times a frame: 1,500-1,800 askings a frame, 120-180 ms of it on an RX 9070 XT. While Host::execute prepares a submission, the title's writes it must see are already made, so the preparing thread now asks the kernel only about pages it has not asked about in that submission (watch::Sweep). A step that writes title memory during the preparation (Batch::title_written) clears what was asked, so later askings see it. Askings from other threads, and outside a submission, are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`victory compare <before> <after>` reads two `translate --list` outputs and says what the second run gained and lost: each run's pipelines and validations with the gains and losses, the programs that end differently by their reason before and after, and every loss with both reasons. The key is the file's name, offset, record and stage, so copies of the title in other folders compare. Testers measure a change against main this way, each with a script of their own so far.
A wireless receiver answers for its pad while the pad is switched off: the slot reads connected with an all-zero report. That counted as a pad, so the keyboard's stand-in pad was never connected and keyboard input went nowhere with no controller in hand. Treat a slot as a pad only after it has reported something other than rest. Once it has, it stays a pad at rest, so a played-with pad does not connect and disconnect on every button release. The callback test seeds an all-zero pad and waits for its connect callback; it presses a button now.
Heap handles were cached per block by the first property word only (kind and UAV flag), not the second (component type and count). A size query (f32 x4) and then an atomic (u32 x1) on the same image UAV in one block shared the query's handle, so dxil-spirv declared a float image and emitted OpAtomicUMax %float. NVIDIA's compiler faults on that (0xc0000005 in vkCreate*Pipelines under vkd3d-proton). The key now holds both words; structured buffers read with two strides get their own handles too. Offline check (translate --pipelines over shaders.rpf, NVIDIA RTX 5070 Ti, vkd3d-proton master): 21,566 pipelines, no driver fault, every dumped SPIR-V module passes spirv-val. In the title, the world loads without the driver faults. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A slot that reported input, disconnected, and came back neutral kept the flag set, so a receiver that re-paired without a pad took the keyboard stand-in away again. Clear it when the host reports the slot disconnected, so it applies to the current connection only. Regression test and the case are from andrewpozdnakov7-jpg in Marvisak#845. Co-authored-by: andrewpozdnakov7-jpg <andrewpozdnakov7-jpg@users.noreply.github.com>
Louisreed's observation in Marvisak#845: the press that turns an idle slot into a pad arrives in the same poll as its connect callback, so a title that only starts reading after that callback could miss it. The reading stays current until the pad reports something else, so the title sees the press on its next read. Test: the press is still current after a second poll with no host change, and the release produces a new reading. A press that starts and ends between two reads is still lost, which no poll-level fix can avoid.
A change to a title texture's memory detiled every mip and slice again, and the watched path read the whole memory back first. A streamed texture filling page by page paid for all of it at every submission that sampled it. Layout::extents gives the tiled byte ranges each subresource is detiled from. Watched memory now reads again only the pages written since the last detiling; memory that is hashed instead is hashed per 64 KiB page. Either way only the subresources overlapping a changed page are detiled. The first detiling, and memory whose read copy is gone, still take the whole texture, and every subresource is still copied into the host texture. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copy-back read and wrote title memory one 64 KiB piece at a time. In the world of a retail game that is ~650 WriteProcessMemory calls a frame, about 300 ms of an ~850 ms frame, though the bytes compared took ~30 ms: a call costs hundreds of microseconds whatever its size. Consecutive pieces the GPU changed are now read with one call, and the consecutive ones the title lacked a GPU byte in are written with one call. The merge rule per piece is unchanged (GPU bytes only where the copy moved and the title does not have them; title bytes kept elsewhere), and a run that cannot be read whole falls back to piece by piece, so unmapped pieces are still skipped. Measured: copy-back ~350 ms -> ~130 ms a frame.
Marvisak#776 Marvisak#787 Marvisak#805 Marvisak#845 Marvisak#852 Marvisak#915 Marvisak#918), verified together Merges the fork branches named in those issues onto main (ffe310e), each with its commits and its author unchanged, no conflicts and no changes of mine. cargo clippy --workspace --all-targets --locked -- -D warnings, with and without --all-features, is clean and cargo test --workspace --locked passes (360 passed, 6 ignored; main has 342 passed, 6 ignored). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Local patches for two issues hit while running GTA VI 1.0.2.1 through VIctory on Linux (GE-Proton 11-14, vkd3d-proton 3.2.0, RTX 4060 Ti 8 GB):
Both are local uncommitted diffs, posted here for reuse. Tested only on the configuration above. diff --git a/crates/victory-gpu/src/dxgi.rs b/crates/victory-gpu/src/dxgi.rs
index c7f7c45..2535b68 100644
--- a/crates/victory-gpu/src/dxgi.rs
+++ b/crates/victory-gpu/src/dxgi.rs
@@ -219,6 +219,19 @@ struct Mode {
}
const _: () = assert!(size_of::<Mode>() == 32);
+/// The console's fixed output mode, overridable for hosts smaller than the
+/// console's 4K target: `VICTORY_MODE=1920x1080` reports that instead.
+fn mode_size() -> (u32, u32) {
+ const DEFAULT: (u32, u32) = (3840, 2160);
+ let Some(text) = std::env::var_os("VICTORY_MODE") else {
+ return DEFAULT;
+ };
+ let text = text.to_string_lossy();
+ text.split_once('x')
+ .and_then(|(w, h)| Some((w.trim().parse().ok()?, h.trim().parse().ok()?)))
+ .unwrap_or(DEFAULT)
+}
+
/// The console's mode list: one 4K mode at 60 Hz (Grand Theft Auto VI looks
/// for a 120 Hz one to allow 120 Hz frame intervals).
/// shortcut: fixed mode, not the host display's; report the host's rates if
@@ -242,9 +255,10 @@ extern "system" fn modes(
return MORE_DATA;
}
*count = 1;
+ let (width, height) = mode_size();
let mode = Mode {
- width: 3840,
- height: 2160,
+ width,
+ height,
refresh: [60, 1],
format: 0,
scanlines: 1, // progressive
diff --git a/crates/victory-hle/src/modules/gameinput.rs b/crates/victory-hle/src/modules/gameinput.rs
index a411bd0..da8d66c 100644
--- a/crates/victory-hle/src/modules/gameinput.rs
+++ b/crates/victory-hle/src/modules/gameinput.rs
@@ -1134,6 +1134,11 @@ mod host {
impl Source for Host {
fn pad(&mut self, slot: usize) -> Option<PadState> {
+ // The keyboard stand-in pad only exists while no host pad is
+ // connected; this hides a host pad the title mis-handles.
+ if std::env::var_os("VICTORY_NO_HOST_PAD").is_some() {
+ return None;
+ }
if self.empty_until[slot].is_some_and(|until| Instant::now() < until) {
return None;
} |
|
Automated triage for the maintainers. Closing because this pull request re-packages other open pull requests. Each of those is reviewed on its own, so a bundle cannot be merged. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution. |
|
Automated triage for the maintainers. Needs rebase. This pull request conflicts with Generated by Claude Code |
Eight fixes from contributors' forks, in one PR. Each was reported as an issue that points to a fork branch and a commit (written when pull requests were still limited to collaborators), and none of their authors has a pull request. The branches are merged here as they are, with their commits and their authors, onto
main(ffe310e); nothing is changed. Same idea as #1603, which carries four fixes of one contributor.What is inside
shader/med3-nan-bitsc796377v_med3with a NaN operand gives the median on NVIDIA (fcmp unofolded)gpu/write-watch-once-per-submission;gpu/write-watch-preserve-partial-resultsc326bfa;32ec0f4c326bfaby DrDarkDK and lucaseddd)cli/translate-compare31953eavictory compare: an A/B of twotranslate --listoutputs, program by programfix/loadlibrary-datafile-host343aa42LOAD_LIBRARY_AS_DATAFILEloads outsideHostPolicyfail withERROR_MOD_NOT_FOUNDfix/idle-receiver-keyboarda6884a3shader/atomic-handle-typeae7e0begpu/partial-detileaf4fef4shadow-batched-copy-back4c0d57dThe reasoning, the repro and the measurements of each are in its issue; each branch has its own tests where it adds behaviour.
Left out
fix/keyboard-beside-xinput-pad): conflicts with Input: a receiver answering for a switched-off pad hides the keyboard stand-in (fix on a fork) #845 ingameinput.rs, both being about the keyboard stand-in next to a pad; they need to be reconciled by their authors.main), Patch (fork): lower 64-bit image atomics, SMEM descriptor size reads, and spilled lane masks (+657 PSOs on RTX 5060 Ti) #728 and Patch (fork): GTA VI bring-up fixes (descriptors, V#, atomics, caches) and mesh-shader TDR on RTX 3080 Ti #815 (large patch collections), GPU: NVIDIA's shader compiler overflows the pipeline worker's 2 MB stack and the pipeline is refused as out of memory (fix on a fork) #966 (a 64 MB stack for the pipeline workers, which GPU: give pipeline workers room for NVIDIA's shader compiler #1129 already does) are not carried.Notes
32ec0f4is lucaseddd's follow-up on top ofc326bfa, from the thread of GPU: write-watch askings repeat over nested buffers (120-180 ms a world frame); a fix is on a branch #776 (their branchgpu/write-watch-preserve-partial-results; GitHub denies them a pull request, they say there). It is merged as it is, with its author and its test. EduAzevedo's3284f19(one query for a whole allocation) is not included: its author says the frame is not faster with it and leaves it for whoever takes the sweep in.main; GPU: write-watch askings repeat over nested buffers (120-180 ms a world frame); a fix is on a branch #776, GPU: detile only the subresources a texture's changed pages hold (fix ready on a fork) #915 and Shadows: put a run of GPU-written pieces back with one kernel call (fix on a fork) #918 touch the same files as some GPU bundles ([BUNDLE] GPU fixes (write watch, textures, device, DXGI, objects, primitives, capture): 9 PRs, #553 #153 #270 #1158 #1204 #1220 #488 #1146 #631 (rebuilt on main 70564ae) #1418, [BUNDLE] GPU host copies, descriptors, sampler heaps and footprints: 5 PRs, #322 #982 #409 #474 #1206 (rebuilt on main 70564ae) #1426, [BUNDLE] GPU pipeline library, shader cache, draw state and frame wait: 5 PRs, #1000 #626 #642 #174 #1279 (rebuilt on main 70564ae) #1439, [BUNDLE] GPU fixes 4: 3 PRs, #1082 #1173 #1265 (rebuilt on main 70564ae) #1542), so after one of them lands the other may need a rebase.Verification
Windows 11, RX 6950 XT, Rust 1.98.1 (the pinned toolchain):
cargo clippy --workspace --all-targets --locked -- -D warningscargo clippy --workspace --all-targets --all-features --locked -- -D warningscargo test --workspace --lockedmain: 342 passed, 6 ignored), two runsThe title was not run. No game data is used or committed.
Re-verify in one go
AI-assisted (Claude Code); no game data.
🤖 Generated with Claude Code