From 35155bed9a09bb628d57a27c9b1680f100d23769 Mon Sep 17 00:00:00 2001 From: local Date: Wed, 25 Nov 2026 13:32:18 -0600 Subject: [PATCH] Frame replay: --shaders takes passes of ours too, by their own hash Co-Authored-By: Claude Opus 5.5 --- crates/victory-gpu/src/replay/play.rs | 5 +++-- docs/replay.md | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/victory-gpu/src/replay/play.rs b/crates/victory-gpu/src/replay/play.rs index fa55c85..3c12228 100644 --- a/crates/victory-gpu/src/replay/play.rs +++ b/crates/victory-gpu/src/replay/play.rs @@ -97,7 +97,7 @@ pub struct Options { /// these in it. pub skip_shaders: Vec, /// Shaders taken from this folder where it has them: `.dxil`, by - /// the hash the runtime names the title's shader by. + /// the hash the runtime names the title's shader by (ours: by their own). pub shaders: Option, /// With `compare`: the folder the shaders of the second are from. pub shaders_b: Option, @@ -948,7 +948,8 @@ impl Player { let taken = std::cell::Cell::new(false); let mut m = super::pso::make(&device, &p.parts, root, |i| { let other = shaders.and_then(|dir| { - let hash = title_hash(p, i)?; + let own = || frame.codes.get(i as usize).map(|c| c.hash[..8].iter().map(|b| format!("{b:02x}")).collect()); + let hash = title_hash(p, i).map(str::to_owned).or_else(own)?; std::fs::read(dir.join(format!("{hash}.dxil"))).ok() }); taken.set(taken.get() || other.is_some()); diff --git a/docs/replay.md b/docs/replay.md index 8dcd7e6..11c01d6 100644 --- a/docs/replay.md +++ b/docs/replay.md @@ -69,7 +69,7 @@ with the presented one. | `--only 3..7` | runs these lists; of the others only barriers | | `--no-merge` | copies of what the CPU wrote also overwrite the card's own results (below) | | `--skip-shader ` | leaves out what runs pipelines with the text in their name or DXIL hash (repeatable) | -| `--shaders ` | takes shaders from the folder where it has them: `.dxil`, by the hash the runtime names the title's shader by; with `--compare --shaders-b ` a second set, turn by turn with the first | +| `--shaders ` | takes shaders from the folder where it has them: `.dxil`, by the hash the runtime names the title's shader by (a pass of ours: its own DXIL hash); with `--compare --shaders-b ` a second set, turn by turn with the first | | `--retranslate ` | only writes that folder: the capture's shaders translated by this build with the `VICTORY_*` switches of this run (`--view-limit`, `--raw-views`: the view heap's null slot and where raw views start, as the capture's shaders have them) | | `--no-restore` | leaves what a loop changed, and makes no copies to restore from (of a capture that does not fit in the card's memory with them) | | `--pace ` | a wait after each submission sent: the card stands idle between them, as in a game that prepares the next one |