GPU: sample packed 10-bit frames for black-frame diagnostics #2960
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2962"
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 andrewpozdnakov7-jpg on 2026-11-26T01:38:59Z.
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 main63bcca43c6a00a758510398fa43096ce7e4f7df0, 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.
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T01:55:48Z.
Review: COMMENTED
Reviewed and verified against
main(63bcca43) on Windows 11 (RTX 5090 + WARP,--features diagnostics,VICTORY_D3D12_DEBUG=1) — clean and ready to merge:diagnostics(zero impact on default builds).capture.rs:789-798, 891-896addsBlackProbe { buffer, packed_rgb10 }supportingDXGI_FORMAT_R10G10B10A2_{TYPELESS,UNORM,UINT}, unpacking the three 10-bit RGB channels and scaling((max * 255 + 511) / 1023) as u8against the< 8black threshold while ignoring 2-bit alpha. (Non-blocking note:capture.rs:659's full-frame dump also handles format89XR_BIAS, which isn't included here.)Local verification:
packed_10_bit_frames_are_sampled_for_black_detection: passed on both RTX 5090 and WARP (--features diagnostics,VICTORY_D3D12_DEBUG=1)cargo clippy -p victory-gpu --all-targets(default &--features diagnostics) +cargo xtask policy(191 files ok): 0 warningsImported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-26T02:25:20Z.
Review: COMMENTED
Verified: the probe only handled 8-bit formats, so R10G10B10A2 back buffers never got black-frame detection. The fix is right on both axes — TYPELESS is viewed as UNORM for the copy footprint (legal since the buffer footprint just names texel layout), and the 10-bit channels are unpacked and rescaled to the existing 8-bit scale with alpha ignored. The hardware test covers all four format/view combos including the UINT path.
Imported from Marvisak/VIctory. Originally posted by steven-seagull27 on 2026-11-26T02:15:52Z.
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.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.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-26T05:39:53Z.
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_formatinhost.rsmaps formats 23..=25 to anR10G10B10A2_UNORMswap chain), and for those the probe returnedNone, sopresentnever reported a black frame. The PR adds the three R10G10B10A2 formats, copies a typeless source through a UNORM footprint, and incapture::blackscales 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
Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T07:10:36Z.
Review: APPROVED
Tested locally merged onto
origin/main(63bcca4) on Windows 11 x64 (NVIDIA GeForce RTX 5090 + WARP):cargo test -p victory-gpu --features diagnostics capture:: -- --test-threads=1(RTX 5090 & WARP): all tests passed on both.cargo clippy -p victory-gpu --features diagnostics --all-targets -- -D warnings: 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 andrewpozdnakov7-jpg on 2026-11-28T06:56:29Z.
I combined #2962 at
895fc15with #3687 at3e91c42in 0e426a2. Both changes touch the black-frame probe. The resolution uses the copy format to choose how to read RGB, keeping the same 8-bit level scale for all three encodings.Six isolated WARP runs covered RGBA8, FP16 and its typeless family, and all three R10G10B10A2 formats. Each run used the normal presentation path and produced
[black, black, nonblack, nonblack]for opaque black, near-black red, green at level 8 and bright blue. The separate conversion unit test, strict GPU Clippy and the asset policy passed.A maintainer can use this resolution if both PRs land together.
Please retain the Git authors on cherry-pick or rebase, or add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>if folding this resolution into another commit.AI-assisted with OpenAI Codex.
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.