GPU: keep constant nonzero targets visible in captures #2484
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2486"
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-25T14:42:21Z.
A flat single-channel target has no contrast to stretch. The capture code subtracts its minimum from every pixel, so a depth buffer cleared to a nonzero value appears black and the dump filename receives the
-blacksuffix. This can make a nonzero target look empty during rendering diagnostics.Show a constant nonzero value as white in the grayscale dump. A zero target stays black and a varying target keeps its existing grayscale range.
The same synthetic readback test produced
[0, 0, 0, 255]for the constant D32_FLOAT input0.25on940d32f, then[255, 255, 255, 255]with the fix. The negative R32_FLOAT, zero-depth and varying-depth controls passed. All three capture tests, strict GPU Clippy with diagnostics, and the staged asset policy passed on Windows. This is a CPU-side capture conversion test with synthetic pixels.Coordination claim
Please retain the Git author when cherry-picking or rebasing. If you fold the change into another commit, please add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.AI-assisted with Codex.
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T14:57:45Z.
Review: COMMENTED
Keep constant nonzero targets visible in captures. Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1.
Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-25T15:13:29Z.
Review: COMMENTED
Windows verification to go with the earlier macOS static review.
VICTORY_D3D12_WARP=1(WARP only, no hardware GPU touched). Tested commit7ab6e539921f8147f91070dba8f2963edba5dac0(clean detached checkout).Note: the
capturemodule is#[cfg(all(windows, feature = "diagnostics"))]. Without the feature,cargo test -p victory-gpu --lib capturecompiles and runs 0 tests, so the new test only runs with--features diagnostics.cargo test -p victory-gpu --locked --lib --features diagnostics capture— 3 passed, 0 failed, 0 ignored (includesconstant_nonzero_grayscale_targets_do_not_look_black).flat_nonzeroforced tofalse, the new test fails, so it guards the change.cargo test -p victory-gpu --locked --lib— 143 passed, 0 failed, 2 ignored.cargo test -p victory-gpu --locked --lib --features diagnostics— 147 passed, 0 failed, 2 ignored.Code read:
flat_nonzero = grey && low == high && low != 0.0applies only to the grey formats (19..=22 | 39..=47 | 53..=65). Non-finite pixels still go through the old path. An all-non-finite target never satisfieslow == high, becauselowstaysf32::MAXandhighstaysf32::MIN. Constant-zero and varying targets are unchanged, and the test asserts both. A negative constant also renders white, which the test covers. One minor point:rustfmt --checkreports diffs incapture.rs, but they are in lines this PR does not touch (e.g.listed()), so they are not caused by it. No problems found.AI-assisted (Claude Code / Claude Sonnet 5.5)
Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-25T15:45:19Z.
Independent local validation for PR #2486 (Windows, Rust 1.100.0/MSVC, head
7ab6e53, no game data):cargo test --locked -p victory-gpu --lib-> 143 tests passed, 0 failed, 2 ignored, exit 0. CPU-only regression run; synthetic capture path not replayed. AI-assisted (Hy4 flash). GPU/driver noted only for provenance (RTX 5060 Laptop, driver 621.24).Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T15:56:44Z.
Automated triage for the maintainers.
Verdict: merge candidate (unchanged). The new head is a merge of
main. The PR diff is the same as before, still onlycrates/victory-gpu/src/capture.rs. Into_rgba, a grey target whose pixels all hold one finite nonzero value is shown white instead of stretching to black (and getting the-blacksuffix). Zero targets, varying targets and non-finite pixels are unchanged. The new unit test covers all four cases. It only affects diagnostic dumps.CI: passing (
check).Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T20:10:38Z.
Review: APPROVED
Verified locally merged onto
origin/main(63bcca43) at PR head7996a011(Windows 11 x64, NVIDIA RTX 5090 + Microsoft WARP,VICTORY_D3D12_DEBUG=1):crates/victory-gpu/src/capture.rs(to_rgba): addsflat_nonzero = grey && low == high && low != 0.0and maps finite pixels to255instead of collapsing constant nonzero single-channel targets to black (matching the existingr32_integer_to_rgbaconvention). Keepingc.is_finite()preserves existing non-finite handling when mixed with a constant finite value, and all-non-finite/empty targets stay unaffected (low = f32::MAX,high = f32::MIN).cargo xtask policy: 191 files ok.cargo clippy --locked -p victory-gpu --all-targets -- -D warnings(default and--all-features): 0 warnings.cargo test --locked -p victory-gpu --features diagnostics --lib capture::: 12/12 passed (includingconstant_nonzero_grayscale_targets_do_not_look_black).[-0.0, -0.0]-> black, all-NaN-> black, all--Inf-> black, all-+Inf-> white, mixed[0.25, NaN, +Inf, -Inf]->[white, black, white, black], constant subnormalf32::MIN_POSITIVE / 2.0-> white, and empty0x0->Some([]).#2518(both editcapture.rs): clippy (default and--all-features) clean, and all combined capture/GPU tests pass on both RTX 5090 and WARP (including constant negative signed R8 rendering white while zero stays black).Synthetic tests only; looks ready to merge.
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.