victory replay --flow, --images, --until; shader-info names the hashes

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
localandClaude Opus 5.5 committed 2026-11-25 00:00:07 -06:00
1 parent 795d55eb73
commit 0fdcaa3b1a
5 files changed
+521 -1

No files matched your search

+59
View File
@@ -136,6 +136,35 @@ pub(crate) struct Replay {
/// Only write the frame's buffers and the commands of these lists (`3..7`).
#[arg(long)]
listing: Option<String>,
/// Only write what the dispatches of these lists have bound (`3..7`).
#[arg(long)]
flow: Option<String>,
/// With --flow: draws too.
#[arg(long)]
flow_draws: bool,
/// With --flow: heap slots shown from each place named.
#[arg(long, default_value_t = 40)]
flow_slots: u32,
/// Run the frame once and save textures as pictures in this folder, with
/// what values they hold (see --texture, --until).
#[arg(long)]
images: Option<PathBuf>,
/// With --images: `<resource>[.<subresource>]` (repeatable); none: all
/// that the frame's shaders write.
#[arg(long)]
texture: Vec<String>,
/// With --images and no --texture: from this many texels on.
#[arg(long, default_value_t = 4096)]
least: u64,
/// With --images: the widest picture.
#[arg(long, default_value_t = 960)]
width: u32,
/// With --images: the values too.
#[arg(long)]
raw: bool,
/// The last command that runs, `<list>:<command>`; after it only barriers.
#[arg(long)]
until: Option<String>,
/// Use the D3D12 debug layer (slow).
#[arg(long)]
debug_layer: bool,
@@ -160,6 +189,18 @@ pub(crate) fn run(r: Replay) -> Result<()> {
let lists = range(text).with_context(|| format!("--listing {text}"))?;
return play::listing(&r.folder, lists, &mut |line| println!("{line}"));
}
if let Some(text) = &r.flow {
let lists = range(text).with_context(|| format!("--flow {text}"))?;
return play::look::flow(&r.folder, lists, r.flow_draws, r.flow_slots, &mut |line| println!("{line}"));
}
let until = match &r.until {
Some(text) => Some(
text.split_once(':')
.and_then(|(l, c)| Some((l.parse().ok()?, c.parse().ok()?)))
.with_context(|| format!("--until {text}: not <list>:<command>"))?,
),
None => None,
};
let only = match &r.only {
Some(text) => Some(
range(text)
@@ -189,6 +230,7 @@ pub(crate) fn run(r: Replay) -> Result<()> {
wait_all: r.wait_all,
wait_lists: r.wait_lists,
only,
until,
skip_shaders: r.skip_shader,
compare: r.compare,
debug: r.debug_layer,
@@ -201,6 +243,23 @@ pub(crate) fn run(r: Replay) -> Result<()> {
let player = play::Player::load(&r.folder, &options)?;
return player.slots(list, command, &mut |line| println!("{line}"));
}
if let Some(folder) = &r.images {
let mut which = Vec::new();
for text in &r.texture {
let (id, sub) = text.split_once('.').unwrap_or((text, "0"));
let bad = || format!("--texture {text}");
which.push((id.parse().with_context(bad)?, sub.parse().with_context(bad)?));
}
let images = play::look::Images {
which,
least: r.least,
folder: folder.clone(),
width: r.width,
raw: r.raw,
};
let mut player = play::Player::load(&r.folder, &options)?;
return player.images(&options, &images, &mut |line| println!("{line}"));
}
if r.check_written {
let mut player = play::Player::load(&r.folder, &options)?;
return player.check_written(&mut |line| println!("{line}"));
+3 -1
View File
@@ -169,7 +169,9 @@ pub fn run(paths: Vec<PathBuf>, verbose: bool, disasm: bool) -> Result<()> {
None => "no parsable DXIL program".to_owned(),
} + &native;
if verbose {
println!("{}{}: {line}", path.display(), source.label());
// As a run's log and a replay name it (`hash=`).
let hash = blake3::hash(&bytes).to_hex();
println!("{}{} #{}: {line}", path.display(), source.label(), &hash[..16]);
for l in &listing {
println!("{l}");
}