Repository navigation
GPU: target dumps name every writer, and VICTORY_DUMP_AFTER dumps a texture right after a pipeline - #3415
GPU: target dumps name every writer, and VICTORY_DUMP_AFTER dumps a texture right after a pipeline#3415JurajSimicevic wants to merge 2 commits into
Conversation
…fter a pipeline A per-submission dump (`frame-<n>-s<sub>-...-by-<pipeline>`) holds what the whole submission left in a texture, but its name gave only the first pipeline that wrote it, and its doc said it follows a frame "pass by pass". Read as that pipeline's output, it is wrong whenever later commands of the submission write the same texture (an additive lighting target that some 290 draws add to after the compute that "wrote" it, in one capture). - Lists and the frame's dump keep every pipeline that wrote a target, in order. The file name gives the first and `-and-<n>-more`; the log lists them all. - `VICTORY_DUMP_AFTER=<hash>,...`: in listed frames, the 2D textures a dispatch or draw of a matching pipeline writes (unordered views through tables; a draw's render targets and depth) are read back in the list right after that command and saved as `frame-<n>-after-<k>-...` once it has run. `capture::snapshot` does the read-back (UAV barrier, copy-source and back); the existing 1D/3D probe after dispatches now uses it too. - README: what the per-submission files hold, and the new switch. Tests (diagnostics feature): `a_snapshot_right_after_a_dispatch_holds_what_it_wrote` (two dispatches write one texture; the snapshot after the first holds the first's values) and `dump_names_give_the_first_writer_and_how_many_more`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r-dumps named by the frame that ran them The writers a dump lists came from views bound through tables, so the draws that render to a target (render targets, depth) were left out: a target lit by some 180 draws after one compute named only the compute. Draws now add their pipeline when they bind it as a target. Lists are recorded ahead of the frame that submits them, so an after-dump is named when its list has run (as the per-submission dumps are), not when its command was recorded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dukestar69
left a comment
There was a problem hiding this comment.
LGTM — verified on RTX 5090 (Windows / D3D12) against origin/main (63bcca4).
- Naming every writer in target dumps and supporting opt-in
VICTORY_DUMP_AFTERfor post-pipeline texture dumps build and pass cleanly in both default and--features diagnosticsconfigurations. cargo test -p victory-gpu --lib --features diagnostics capture:: -- --test-threads=1: all passed.cargo clippy -p victory-gpu --all-targets -- -D warnings(default +--features diagnostics): clean.cargo xtask policy: 191 files ok.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
|
Tested Both adapters produced exactly two PNGs in that order. All 230,400 sampled pixels in the first PNG were red and all 230,400 in the second were green. A separate full-resolution readback after the fourth draw was blue at all 921,600 pixels. The D3D12 debug layer reported no errors. This exercises two selected draws writing the same target in one list and verifies that a later unselected draw still renders. Synthetic inputs only. AI-assisted test and analysis. |
fuzeofficlal
left a comment
There was a problem hiding this comment.
Looks good. Verified all code paths, diagnostics feature gating, and live D3D12 behavior on both RTX 5090 and WARP with VICTORY_D3D12_DEBUG=1:
cargo xtask policyandcargo clippy --tests -p victory-gpu(both default and--features diagnostics,-D warnings) pass cleanly, and all new hooks indraw.rsandhost.rsremain properly gated behind#[cfg(feature = "diagnostics")].add_writer/writers_labelpreserve writer order cleanly without stripping the-and-<n>-moreor-twin<p>suffixes insave_target.capture::tests(6/6),a_snapshot_right_after_a_dispatch_holds_what_it_wrote(1/1), anddraw::tests(21/21) all pass on both RTX 5090 and WARP.- Additionally tested
capture::snapshotand end-to-endcapture::dump_after(deferred PNG write) onR8G8B8A8_UNORM(RENDER_TARGET),D32_FLOAT(DEPTH_WRITE), andR24G8_TYPELESS(DEPTH_WRITE) textures on both RTX 5090 and WARP: all snapshots and saved PNGs succeeded with zero D3D12 debug layer messages.
Problem
With
VICTORY_DUMP_TARGETS, each submission of a listed frame dumps the textures its lists wrote, asframe-<n>-s<sub>-<i>-…-by-<pipeline>.png. Two things made these files easy to misread:An example, in the world on an RTX 5080, counts only:
I read such files as the named pass's output twice in my own reports on #2711, and others measure the same way.
Change
Writers.
-and-<n>-more; one log line lists them all.VICTORY_DUMP_AFTER=<hash>,.... In listed frames, a texture can now be dumped right after one pipeline's command:frame-<n>-after-<k>-…, wherenis the frame whose submission ran it andkcounts these dumps in order.Shared code.
capture::snapshotdoes the read-back: a UAV barrier, copy-source, then back to the state the next command needs.probe_written) now uses it too.dump_oneis split into its read-back andsave_target, which both paths use.Scope.
crate::twin), whose unordered writes are not in the texture yet; they are skipped with a log line. 1D, 3D and multisampled targets are not dumped after a command.capture.rs,draw.rs,host.rs(allvictory-gpu) andREADME.md.Tested
Unit and GPU tests:
cargo test -p victory-gpu --features diagnostics --lib:VICTORY_D3D12_WARP=1): 248 passed.dynamic_slots_are_held_until_releasedandlists_share_a_table_and_copies_keep_their_views, which fail onmainon NVIDIA too (Two victory-gpu tests assume a host whose shader-visible heap reaches HEAP_VIEWS, so they fail on hosts that cap it (Intel Arc here) while CI cannot see either #3178).draw::tests::a_snapshot_right_after_a_dispatch_holds_what_it_wrote. Two dispatches write one texture; the snapshot after the first holds the first's values, and the one after the second holds the second's. Expecting the second's values after the first makes it fail.capture::tests::dump_names_give_the_first_writer_and_how_many_more.cargo clippy -p victory-gpu --all-targets --locked -- -D warnings, with and without--features diagnostics: clean. No other crate changes.In the title (RTX 5080):
main+ GPU: an acceleration structure's view address is its location #2098, GPU: packed 16-bit colour targets the host cannot write are RGBA8 there #2626, GPU, Shaders: a capped view heap clamps shader heap indices from the first shader #2628, GPU: on NVIDIA, structured buffer views are made raw #2464, GPU: the BVH builder runs whole or not at all #2118, Shaders: one console wave sharing LDS runs in the console flow on 32-lane hosts #439 ate2d3cfd, and local diagnostic logging) with this change.VICTORY_DUMP_TARGETS=1,VICTORY_CAPTURE_WORLD=150, andVICTORY_DUMP_AFTERnaming three compute pipelines.-and-188-more.Overlap: #3388 also changes
dump_one(footprint checks before mapping). Whichever lands second moves those checks intosave_target.No game data: counts and file-name shapes only.
AI-assisted.
🤖 Generated with Claude Code