Preserve signed R16 contrast in PNG captures #2320
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!2320
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2320"
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?
@DoubleD17 on GitHub · 2026-11-25 10:35 UTC · original
DoubleD17:fix/signed-r16-capture-contrast→main· +44 −3 · 1 files · 1 commits · openThe diagnostic capture converter treated signed R16 texture channels as unsigned, which could turn negative components into bright pixels. Decode the six signed R16 SNORM and SINT DXGI formats as little-endian i16 and keep the existing display normalization. On Windows with Rust 1.98.1, the base with the regression fixtures passed 2 of 4 focused tests and this commit passed 4 of 4. The synthetic tests check the RGBA passed to the PNG encoder for signed color and grayscale, including an unsigned control.
AI-assisted.
@cloph-dsp on GitHub · 2026-11-25 12:39 UTC · original
Independent local validation (Windows, Rust 1.100.0/MSVC, head
49bcd08, no game data):cargo test --locked -p victory-gpu --lib --features diagnostics signed_r16-> 2 tests passed (signed_r16_colours_do_not_brighten_negative_components,signed_r16_luma_keeps_negative_zero_and_positive_in_order), exit 0. The same command on main940d32fmatches 0 tests, confirming the PR adds both. Note:mod captureis gated by#[cfg(all(windows, feature = "diagnostics"))]at crates/victory-gpu/src/lib.rs:21-22, so the--features diagnosticsflag is required; the plaincapture::filter matches nothing. Two pre-existingfetch_update/try_updatedeprecation warnings. I did not run a real title capture or verify the PNG output with game data. AI-assisted (Hy4 flash). GPU/driver: N/A (CPU unit tests with diagnostics feature). No game data, assets or extracted content used.@Marvisak on GitHub · 2026-11-25 15:17 UTC · original
Automated triage for the maintainers.
Merge candidate (worth a look). In
capture.rsto_rgba, this decodes the signed 16-bit formats asi16instead ofu16: R16G16B16A16 SNORM/SINT (13, 14), R16G16 SNORM/SINT (37, 38) and R16 SNORM/SINT (58, 59). Negative components therefore no longer show up as bright pixels in diagnostic PNG captures. I checked the format ranges against the DXGI numbering, so the UNORM/UINT and D16 arms keep the unsigned path, and worked the new tests through the existing scaling (colour clamped at 0 and scaled by p99; grey scaled from min to max): the expected bytes match. CI: passing.Generated by Claude Code
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.