GPU: preserve integer contrast in R32 captures #1893
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1895"
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 DoubleD17 on 2026-11-25T00:17:06Z.
The 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 onba1a666withcargo 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.
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T00:32:48Z.
Review: COMMENTED
Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.
Integer contrast preserved in R32 captures: capture-path format fix for integer formats.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T02:17:41Z.
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
fspx_programs_run_with_the_hardwares_dot_productsfails on RDNA1, where the driver folds a constantDot4AddI8Packedoperand as unsigned #1781Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-25T15:23:22Z.
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.