GPU: keep constant nonzero targets visible in captures #2486
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2486
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@andrewpozdnakov7-jpg on GitHub · 2026-11-25 14:42 UTC · original
andrewpozdnakov7-jpg:codex2/capture-uniform-grayscale→main· +26 −1 · 1 files · 2 commits · openA 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.
@cloph-dsp on GitHub · 2026-11-25 15:45 UTC · original
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).@Marvisak on GitHub · 2026-11-25 15:56 UTC · original · edited 2026-11-26 03:25 UTC
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
@catminou4 on GitHub · 2026-11-25 14:57 UTC · original · reviewed
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.
@oni-swr on GitHub · 2026-11-25 15:13 UTC · original · reviewed
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)
@fuzeofficlal on GitHub · 2026-11-26 20:10 UTC · original · approved these changes
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.