GPU diagnostics: encode completed frame captures off the present thread #142

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

@⁠Cuebert on GitHub · 2026-11-24 21:49 UTC · original
Cuebert:codex/async-frame-png → main · +122 −2 · 3 files · 1 commits · open

The diagnostic capture path encodes and writes each PNG between the GPU copy completing and the swap chain presenting. This can delay a frame even when the GPU is ready.

Move the completed readback to one encoder thread. It owns the D3D12 resource until the PNG is written. The queue holds two waiting frames and applies backpressure when full. Normal title exit drains the queue. VICTORY_CAPTURE_SYNC=1 keeps a requested frame on the synchronous path for crash investigations.

Verification

  • On Windows, the GPU diagnostics suite passed 118 tests with one ignored. The new regression queued four padded BGRA readbacks, exited through the title's CRT exit path and compared every PNG byte with the synchronous reference. It passed on hardware and WARP. Disabling the exit drain made the test fail with a missing frame.
  • cargo test --workspace --locked passed 496 tests with seven ignored. Workspace all-target, all-feature Clippy with warnings denied and the staged asset-policy check passed.

The change affects diagnostic screenshots. Whole-game frame time was not measured on this head. AI-assisted development and testing with Codex.

**@⁠Cuebert** on GitHub · 2026-11-24 21:49 UTC · [original](https://github.com/fxceless/victory-fork/pull/142) `Cuebert:codex/async-frame-png` → `main` · +122 −2 · 3 files · 1 commits · open The diagnostic capture path encodes and writes each PNG between the GPU copy completing and the swap chain presenting. This can delay a frame even when the GPU is ready. Move the completed readback to one encoder thread. It owns the D3D12 resource until the PNG is written. The queue holds two waiting frames and applies backpressure when full. Normal title exit drains the queue. `VICTORY_CAPTURE_SYNC=1` keeps a requested frame on the synchronous path for crash investigations. ### Verification - On Windows, the GPU diagnostics suite passed 118 tests with one ignored. The new regression queued four padded BGRA readbacks, exited through the title's CRT exit path and compared every PNG byte with the synchronous reference. It passed on hardware and WARP. Disabling the exit drain made the test fail with a missing frame. - `cargo test --workspace --locked` passed 496 tests with seven ignored. Workspace all-target, all-feature Clippy with warnings denied and the staged asset-policy check passed. The change affects diagnostic screenshots. Whole-game frame time was not measured on this head. AI-assisted development and testing with Codex.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:36:53 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

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