GPU: capture render and depth targets written by clears #2732
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2732
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2732"
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?
@andrewpozdnakov7-jpg on GitHub · 2026-11-25 19:14 UTC · original
andrewpozdnakov7-jpg:codex2/capture-clear-only-targets→main· +216 −20 · 4 files · 3 commits · openSummary
Record textures written by ClearRenderTargetView and ClearDepthStencilView in diagnostic captures. A guest can clear a view without binding it through OMSetRenderTargets. Both the submission capture and the present capture now include that texture.
A clear carries no pipeline name. If a later binding names the same texture, capture retains that name across the lists in the submission.
Verification
The same synthetic guest-vtable fixture on
13f91caemits just two PNGs for a blue control that is later bound. With this change it emits six. The four additional PNGs contain a red color clear and a two-tone depth clear at submission and at present. The fixture decodes every PNG, checks the pixels and verifies the blue control retains its pipeline label.The targeted regression passed on D3D12 WARP. The app-local WARP GPU library suite, strict GPU Clippy with and without diagnostics, and the staged asset policy also passed.
Coordination claim
Please retain the Git author if cherry-picking or rebasing this commit. If folding it into another commit, add Co-authored-by: andrewpozdnakov7-jpg [email protected].
AI-assisted. Verification used synthetic textures and command lists.
@fuzeofficlal on GitHub · 2026-11-25 19:36 UTC · original
Independent Windows 11 + NVIDIA GeForce RTX 5090 + WARP verification and review of
a7c5f5a7(on13f91ca):Verification (
rustc 1.98.1MSVC)cargo xtask policy: 184 files ok.cargo clippy --locked -p victory-gpu --all-targets -- -D warningsand--features diagnostics: 0 warnings.VICTORY_D3D12_WARP=1):cargo test --locked -p victory-gpu --features diagnostics-> 199 passed, 0 failed, 1 ignored (includingresource::tests::clear_only_targets_are_captured_without_a_pipeline_name).diagnostics):cargo test --locked -p victory-gpu --lib -- clear-> 4 passed, 0 failed (all capture hooks cleanly compiled out).Review & Merge-Ordering Notes
writer(note_clear->note_write(..., false)) and promoting empty writers to named pipeline writers on subsequent binds avoids attributing clears to an unrelated prior pipeline, with zero overhead outsidefeature = "diagnostics".capture.rsandresource.rs) and #2673 (only 1-line adjacent context neardump_submissioninhost.rs).@kotekompotek on GitHub · 2026-11-25 20:06 UTC · original
Sensible attribution: clears get recorded with an empty writer name, and record_capture_target backfills the writer only when the stored one is empty - so a later pipeline write in the same frame claims the dump over the clear, and a clear-only frame still names the resource. The DSV flag check (flags & 3 != 0) matches which clears actually write.
@Marvisak on GitHub · 2026-11-25 23:21 UTC · original · edited 2026-11-26 07:18 UTC
Automated triage for the maintainers.
Merge candidate. Re-reviewed at
20acb8f.clear_rtvandclear_dsv(the latter only when depth or stencil is cleared) incrates/victory-gpu/src/list.rscallcapture::note_clear. That records the target with an empty writer instead of the stale bound pipeline.record_capture_target(host.rs) andnote_write(capture.rs) fill in the writer name when a later pipeline binding names the same target. All of this is behinddiagnostics.The process-spawning test is gone.
clear_only_targets_are_captured_without_a_pipeline_namenow runs in-process through the thread-scopedwith_test_capture. It drives the guest clear calls and checks six PNGs: pixels, the absence of the stale name, and the later name. The scaffolding is the same as in #2702.Reply to the author: thanks, this resolves the point.
CI:
checkpassing.Generated by Claude Code
@andrewpozdnakov7-jpg on GitHub · 2026-11-26 06:27 UTC · original
Commit 20acb8f ports the regression to the current test process and brings the branch onto current
main. Capture settings and pending targets are scoped to the test thread. Guest RTV/DSV clears still go through the command list ABI. The test checks color and depth PNGs at submission and present, exact pixels, and whether a later pipeline binding supplies the writer name.On app-local WARP the same test yielded only the two named control images with the clear hooks disabled, and all six expected images with them enabled. Full GPU suite 247 passed and 1 ignored. Strict GPU Clippy passed with default and all features, and asset policy passed.
Please retain the Git author if moving the test. If folding it into another commit, please add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.@fuzeofficlal on GitHub · 2026-11-26 14:15 UTC · original · approved these changes
Reviewed and verified head
20acb8fb10f7eab4af20ed9485af9fd05edfb594(clean merge withorigin/main63bcca43) on Windows 11 x64 with NVIDIA GeForce RTX 5090 and D3D12 WARP (VICTORY_D3D12_WARP=1,VICTORY_D3D12_DEBUG=1, Rust 1.98.1).Code review
#[cfg(feature = "diagnostics")](crates/victory-gpu/src/list.rs:1039,1082-1083,host.rs:1663,2042,capture.rs), keeping default and--releasebuilds completely zero-overhead.clear_rtvnotes clears only after early-out checks on handle/resource/color, andclear_dsvgates onflags & 3 != 0so no-op clears are not captured.capture::note_clear(capture.rs:338-342) records clears with an empty writer instead of the thread's stale bound pipeline, whilerecord_capture_target(host.rs:1663) andnote_write(capture.rs:369-377) promote an empty writer when a subsequent pipeline binding names the same resource without overwriting an existing pipeline label.with_test_capture(capture.rs:283) is#[cfg(test)]-only and cleans up thread-local state via aDropguard.capture.rswith #594 when both are combined).Verification
cargo xtask policy:191 files ok;cargo clippy --locked -p victory-gpu --all-targets -- -D warnings(default &--all-features): 0 warningsresource::tests list::tests22/22 passed;--releaseclear5/5 passed--features diagnostics,VICTORY_D3D12_DEBUG=1):resource::tests::clear_only_targets_are_captured_without_a_pipeline_name: passed on both (clear-only capture produced 6 PNGs)resource::tests capture::tests list::tests: 28/28 passed on both adaptersorigin/main: strict--all-featuresClippy clean, and bothclear_only_targets_are_captured_without_a_pipeline_nameandmultisampled_color_targets_are_capturedpassed concurrently on both RTX 5090 and WARP underVICTORY_D3D12_DEBUG=1.Clean, well-tested fix; approving.
@andrewpozdnakov7-jpg on GitHub · 2026-11-26 14:36 UTC · original
The #594 conflict raised in review is resolved in integration
5e2e85a, which combines all three exact heads. This PR's six clear-only capture PNGs still match on app-local WARP alongside #2702's two MSAA PNGs and #594's slice-copy regression. Merge order is with the maintainers. WARP results and test details.Please retain the Git authors on pickup. If folding the resolution into another commit, use
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.@Dukestar69 on GitHub · 2026-11-26 18:11 UTC · original · approved these changes
LGTM — verified on RTX 5090 (Windows / D3D12) against
origin/main(63bcca4).cargo test -p victory-gpu --lib --features diagnostics capture:: -- --test-threads=1: 11 passed, 0 failed.cargo test -p victory-gpu --lib resource:: -- --test-threads=1: 18 passed, 0 failed.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).
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.