GPU: target dumps name every writer, and VICTORY_DUMP_AFTER dumps a texture right after a pipeline #3415
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3415"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by JurajSimicevic on 2026-11-26T23:52:33Z.
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 (#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+ #2098, #2626, #2628, #2464, #2118, #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
Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-27T00:07:28Z.
Review: APPROVED
LGTM — verified on RTX 5090 (Windows / D3D12) against
origin/main(63bcca4).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).
Imported from Marvisak/VIctory. Originally posted by Venom2054 on 2026-11-27T00:21:40Z.
Tested
VICTORY_DUMP_AFTERon Windows at6406c5bwith a synthetic four-draw case on an RTX 5070 Ti and WARP. All fourDrawInstancedcalls wrote to the same 1280 × 720, single-sampleR8G8B8A8_TYPELESSresource through anR8G8B8A8_UNORMRTV. The draws wrote blue, red, green, then blue. I selected only the red and green pixel shader hashes.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.
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-27T00:48:33Z.
Review: APPROVED
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.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.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.