GPU: preserve integer contrast in R32 captures #1895
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!1895
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1895/head"
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 00:17 UTC · original
DoubleD17:port/fxceless-347→main· +99 −3 · 1 files · 1 commits · merged 2026-11-25 21:52 UTCThe diagnostic capture path decodes R32_UINT and R32_SINT words as floating-point bit patterns, which can turn distinct integer texels into an all-black preview. Decode the words as integers and scale the exact range to RGBA8. Keep the capture statistics and leave other formats on the existing conversion path.
On Windows x64 with Rust 1.98.1 and MSVC, three new synthetic cases failed on
e82a6ad. All five capture tests passed on ba1a666 withcargo test --offline --locked --jobs 2 -p victory-gpu --features diagnostics --lib capture::tests::. The cases cover signed and unsigned scaling, large adjacent values, and a padded row with signed extrema. Validation was limited to the CPU capture conversion.Adapted from fxceless/victory-fork #347.
AI-assisted.
@Marvisak on GitHub · 2026-11-25 02:17 UTC · original · edited 2026-11-25 20:20 UTC
Automated triage for the maintainers.
Merge candidate (unchanged). The new head keeps the earlier fix:
to_rgbaincrates/victory-gpu/src/capture.rssends formats 42/43 (R32_UINT/R32_SINT) tor32_integer_to_rgba, which reads the words as integers and scales the exact low..high span ini64instead of decoding them asf32bits. That decoding turned small integers into denormals and gave an all-black capture. R32 float, depth and typeless formats stay on the old path, and the "target values" log line is kept.What changed since the last verdict: the head now includes the follow-up proposed in the comments, with co-author credit. A constant nonzero integer target is drawn white, and an all-zero target stays black, so a filled target no longer looks empty. Three new tests cover constant +7 unsigned, constant -7 signed and constant zero. I checked the expected bytes of all six tests against the arithmetic, including the 2x2 padded-pitch case. This is the same rule #2486 (still open) proposes for the float single-channel paths. It is a diagnostics-only change with no dependency changes.
CI: passing (
check).Generated by Claude Code
@andrewpozdnakov7-jpg on GitHub · 2026-11-25 15:23 UTC · original
I checked the exact head
7f69c0fwith constantR32_UINTandR32_SINTreadbacks. Both produced black pixels for a nonzero constant. That makes a filled target look empty in the capture, which is the same grayscale case addressed for the other single-channel paths in #2486.The tested follow-up applies the same rule to this PR's integer converter. The same synthetic inputs (
+7unsigned,-7signed) now produce white, and zero produces black. Six capture tests passed on Windows, including the existing adjacent-integer and full-range/pitch tests. Strict GPU Clippy with diagnostics and staged asset policy passed.If you use the follow-up, please retain its Git author when cherry-picking or rebasing. If you fold it into another commit, please add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.AI-assisted with Codex. Synthetic readback data.