GPU: sample packed 10-bit frames for black-frame diagnostics #2962

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

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-26 01:38 UTC · original
andrewpozdnakov7-jpg:codex1/black-frame-rgb10-probe → main · +106 −11 · 2 files · 1 commits · open

The presenter already accepts the R10G10B10A2 family for its UNORM swap chain. The black-frame probe only sampled 8-bit color, so a black 10-bit frame was reported as nonblack.

Sample the existing pixel grid for all three R10G10B10A2 formats. Read the three packed RGB fields and round the maximum to the existing 8-bit diagnostic scale. Alpha is ignored and the warning threshold stays at 8. This composes cleanly with #2827 (PNG export) and #2837 (warning state).

On Windows/WARP, the same test presents opaque black, near-black red, just-above-threshold green, and bright blue through Host::present. At main 63bcca43c6a00a758510398fa43096ce7e4f7df0, all three 10-bit textures report four nonblack frames. On this patch, UNORM, TYPELESS with an UNORM view, and UINT all report [black, black, nonblack, nonblack]. The RGBA8 control reports this sequence before and after. Six paired runs, full GPU diagnostics suite (247 passed, 1 ignored), strict GPU Clippy with and without diagnostics, and asset policy passed.

AI-assisted.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-26 01:38 UTC · [original](https://github.com/Marvisak/VIctory/pull/2962) `andrewpozdnakov7-jpg:codex1/black-frame-rgb10-probe` → `main` · +106 −11 · 2 files · 1 commits · open The presenter already accepts the R10G10B10A2 family for its UNORM swap chain. The black-frame probe only sampled 8-bit color, so a black 10-bit frame was reported as nonblack. Sample the existing pixel grid for all three R10G10B10A2 formats. Read the three packed RGB fields and round the maximum to the existing 8-bit diagnostic scale. Alpha is ignored and the warning threshold stays at 8. This composes cleanly with #2827 (PNG export) and #2837 (warning state). On Windows/WARP, the same test presents opaque black, near-black red, just-above-threshold green, and bright blue through `Host::present`. At main `63bcca43c6a00a758510398fa43096ce7e4f7df0`, all three 10-bit textures report four nonblack frames. On this patch, UNORM, TYPELESS with an UNORM view, and UINT all report `[black, black, nonblack, nonblack]`. The RGBA8 control reports this sequence before and after. Six paired runs, full GPU diagnostics suite (247 passed, 1 ignored), strict GPU Clippy with and without diagnostics, and asset policy passed. AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:18:44 +00:00
Author
Owner

@⁠steven-seagull27 on GitHub · 2026-11-26 02:15 UTC · original

Tested this head (895fc15) together with #2827 (8e7fd05) on RTX 5080, driver 621.40, and WARP. I resolved each D3D12 device LUID through DXGI. For every 64×64 rendered texture I saved both its source-format readback and the hidden swap-chain back buffer through the production PNG writer, then decoded both PNGs independently with Pillow.

Rendered RGB10 input 8-bit RGB in PNG Diagnostic result on both adapters
Uniform red 30, alpha 0 or 3 (7, 0, 0) level 7, black
Uniform green 31 (0, 8, 0) level 8, nonblack
Uniform blue 30 / 31 (0, 0, 7) / (0, 0, 8) black / nonblack
One red-31 pixel at (24,40); remainder black one (8,0,0) at PNG (12,20) level 8, nonblack
One blue-1023 pixel at (34,34); remainder black one (0,0,255) at PNG (17,17) level 0, black

That last pixel falls between the 4×4 probe locations: the PNG sees it and the probe correctly does not. The same results held for UNORM, TYPELESS with an UNORM RTV, and UINT. A separate 32×32 tile ramp exercised every code 0–1023 in each RGB channel and all four A2 values; all decoded pixels matched the reference, and the diagnostic level matched the brightest sampled channel (246).

Per adapter this covered 24 RGB10 presents, 48 decoded PNGs and 49,152 checked RGB pixels, plus six interleaved FP16 presents. Windows build 26300.10075, local synthetic fixture, no game images. Tested with Codex assistance.

**@⁠steven-seagull27** on GitHub · 2026-11-26 02:15 UTC · [original](https://github.com/Marvisak/VIctory/pull/2962#issuecomment-7180625591) Tested this head (`895fc15`) together with #2827 (`8e7fd05`) on **RTX 5080, driver 621.40**, and **WARP**. I resolved each D3D12 device LUID through DXGI. For every 64×64 rendered texture I saved both its source-format readback and the hidden swap-chain back buffer through the production PNG writer, then decoded both PNGs independently with Pillow. | Rendered RGB10 input | 8-bit RGB in PNG | Diagnostic result on both adapters | |---|---|---| | Uniform red 30, alpha 0 or 3 | (7, 0, 0) | level 7, black | | Uniform green 31 | (0, 8, 0) | level 8, nonblack | | Uniform blue 30 / 31 | (0, 0, 7) / (0, 0, 8) | black / nonblack | | One red-31 pixel at (24,40); remainder black | one (8,0,0) at PNG (12,20) | level 8, nonblack | | One blue-1023 pixel at (34,34); remainder black | one (0,0,255) at PNG (17,17) | level 0, black | That last pixel falls between the 4×4 probe locations: the PNG sees it and the probe correctly does not. The same results held for UNORM, TYPELESS with an UNORM RTV, and UINT. A separate 32×32 tile ramp exercised **every code 0–1023 in each RGB channel** and all four A2 values; all decoded pixels matched the reference, and the diagnostic level matched the brightest sampled channel (246). Per adapter this covered 24 RGB10 presents, 48 decoded PNGs and 49,152 checked RGB pixels, plus six interleaved FP16 presents. Windows build 26300.10075, local synthetic fixture, no game images. Tested with Codex assistance.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-26 05:39 UTC · original

Automated triage for the maintainers.

Merge candidate. capture::probe (crates/victory-gpu/src/capture.rs) only accepted 8-bit RGBA/BGRA formats. Main does present R10G10B10A2 frames (swap_format in host.rs maps formats 23..=25 to an R10G10B10A2_UNORM swap chain), and for those the probe returned None, so present never reported a black frame. The PR adds the three R10G10B10A2 formats, copies a typeless source through a UNORM footprint, and in capture::black scales the largest of the three 10-bit channels to the existing 8-bit threshold, ignoring alpha. UINT sources hold the same raw 10-bit values, so the same scale applies. packed_10_bit_frames_are_sampled_for_black_detection (host.rs) clears real render targets just below and at the threshold for each format. The change is diagnostics-only. It complements, and does not duplicate, the same author's #2827 (PNG capture of these frames).

CI: passing (check).

Recommending a look, not approving.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-26 05:39 UTC · [original](https://github.com/Marvisak/VIctory/pull/2962#issuecomment-7183692393) <!-- victory-triage v1 head=895fc15e93e014be7547d8aaab28d46401f6dfd0 verdict=merge-candidate at=2026-11-26T05:39:43Z --> Automated triage for the maintainers. **Merge candidate.** `capture::probe` (`crates/victory-gpu/src/capture.rs`) only accepted 8-bit RGBA/BGRA formats. Main does present R10G10B10A2 frames (`swap_format` in `host.rs` maps formats 23..=25 to an `R10G10B10A2_UNORM` swap chain), and for those the probe returned `None`, so `present` never reported a black frame. The PR adds the three R10G10B10A2 formats, copies a typeless source through a UNORM footprint, and in `capture::black` scales the largest of the three 10-bit channels to the existing 8-bit threshold, ignoring alpha. UINT sources hold the same raw 10-bit values, so the same scale applies. `packed_10_bit_frames_are_sampled_for_black_detection` (`host.rs`) clears real render targets just below and at the threshold for each format. The change is diagnostics-only. It complements, and does not duplicate, the same author's #2827 (PNG capture of these frames). CI: passing (`check`). Recommending a look, not approving. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request can be merged automatically.
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/2962/head:github-bot/gh-2962'
git switch 'github-bot/gh-2962'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2962'
git switch 'github-bot/gh-2962'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2962'
git switch 'github-bot/gh-2962'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2962'
git switch 'main'
git merge --squash 'github-bot/gh-2962'
git switch 'main'
git merge --ff-only 'github-bot/gh-2962'
git switch 'main'
git merge 'github-bot/gh-2962'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!2962
No description provided.