GPU diagnostics: record per-draw samples on selected capture frames #829

Open
github-bot wants to merge 1 commit from github-bot/gh-829 into main AGit
Owner

@⁠Harveyweiii on GitHub · 2026-11-25 09:29 UTC · original
Harveyweiii:diagnostics/per-draw-samples → main · +463 −5 · 7 files · 1 commits · open

While investigating a dark interior in #12, we could see geometry in the depth buffer but could not tell which individual draws contributed. This adds opt-in D3D12 occlusion counts to the existing frame capture.

Set VICTORY_DRAW_SAMPLES=1, point VICTORY_CAPTURE at an external directory, and select a frame with VICTORY_CAPTURE_FRAMES. Join the draw-query ID in the ops log to the per-frame TSV to see how many samples passed depth and stencil. Indirect commands have one aggregate count. Later draws can overwrite those samples. Sampled submissions use the synchronous path, so these captures should not be used to benchmark frame time.

Verification

Tested against 9376fd6 on Windows with an RTX 4070 Ti SUPER. The synthetic 8 × 8 render target returned 0 samples for an empty draw, 12 for a 3 × 4 scissor, and 64 for full coverage. The same test crosses the 256-query heap boundary and checks the two recording frames' TSV rows.

  • cargo test --locked -p victory-gpu --features diagnostics --lib gpu_reports_empty_scissored_and_full_draws -- --nocapture passed.
  • cargo xtask policy passed (173 files).
  • Local workspace Clippy with warnings as errors still reports the existing sort in draw.rs and unused depth_written field; the default-feature run also reports unused placed_filler_twins. These lines are unchanged by this patch.

Related to #12 for diagnostics. The color issue remains open.

**@⁠Harveyweiii** on GitHub · 2026-11-25 09:29 UTC · [original](https://github.com/fxceless/victory-fork/pull/829) `Harveyweiii:diagnostics/per-draw-samples` → `main` · +463 −5 · 7 files · 1 commits · open While investigating a dark interior in #12, we could see geometry in the depth buffer but could not tell which individual draws contributed. This adds opt-in D3D12 occlusion counts to the existing frame capture. Set `VICTORY_DRAW_SAMPLES=1`, point `VICTORY_CAPTURE` at an external directory, and select a frame with `VICTORY_CAPTURE_FRAMES`. Join the draw-query ID in the ops log to the per-frame TSV to see how many samples passed depth and stencil. Indirect commands have one aggregate count. Later draws can overwrite those samples. Sampled submissions use the synchronous path, so these captures should not be used to benchmark frame time. ### Verification Tested against `9376fd6` on Windows with an RTX 4070 Ti SUPER. The synthetic 8 × 8 render target returned 0 samples for an empty draw, 12 for a 3 × 4 scissor, and 64 for full coverage. The same test crosses the 256-query heap boundary and checks the two recording frames' TSV rows. - `cargo test --locked -p victory-gpu --features diagnostics --lib gpu_reports_empty_scissored_and_full_draws -- --nocapture` passed. - `cargo xtask policy` passed (173 files). - Local workspace Clippy with warnings as errors still reports the existing sort in draw.rs and unused depth_written field; the default-feature run also reports unused placed_filler_twins. These lines are unchanged by this patch. Related to #12 for diagnostics. The color issue remains open.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:52:02 +00:00
Author
Owner

@⁠MamaLeVrai on GitHub · 2026-11-25 10:12 UTC · original

Test report on real hardware: AMD RX 6950 XT (RDNA2), Windows 11, Rust 1.98.1, with a GPU present. I merged this PR's head 0947053 into main 9376fd6 in a throwaway tree (no conflict). cargo clippy --workspace --all-targets --locked -- -D warnings fails with exactly the errors main itself has on this machine (placed_filler_twins never used, depth_written never read, in victory-gpu); with --all-features it fails with the same number of errors as main (4). This PR adds none and removes none. cargo test --workspace --locked: 540 passed, 0 failed, 10 ignored, two runs (main alone: 540 passed, 0 failed, 10 ignored). The title was not run, so this says nothing about in-game effect. No game data.

AI-assisted (Claude Code); no game data.

**@⁠MamaLeVrai** on GitHub · 2026-11-25 10:12 UTC · [original](https://github.com/fxceless/victory-fork/pull/829#issuecomment-7159386020) Test report on real hardware: AMD RX 6950 XT (RDNA2), Windows 11, Rust 1.98.1, with a GPU present. I merged this PR's head `0947053` into `main` `9376fd6` in a throwaway tree (no conflict). `cargo clippy --workspace --all-targets --locked -- -D warnings` fails with exactly the errors `main` itself has on this machine (`placed_filler_twins` never used, `depth_written` never read, in `victory-gpu`); with `--all-features` it fails with the same number of errors as `main` (4). This PR adds none and removes none. `cargo test --workspace --locked`: 540 passed, 0 failed, 10 ignored, two runs (`main` alone: 540 passed, 0 failed, 10 ignored). The title was not run, so this says nothing about in-game effect. No game data. AI-assisted (Claude Code); no game data.
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/host.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/829/head:github-bot/gh-829'
git switch 'github-bot/gh-829'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-829'
git switch 'github-bot/gh-829'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-829'
git switch 'github-bot/gh-829'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-829'
git switch 'main'
git merge --squash 'github-bot/gh-829'
git switch 'main'
git merge --ff-only 'github-bot/gh-829'
git switch 'main'
git merge 'github-bot/gh-829'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.