GPU capture: decode XR-biased RGB before image scaling #2514
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2516"
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-25T15:10:41Z.
Capture diagnostics already unpack
R10G10B10_XR_BIAS_A2_UNORMas 10:10:10:2 after #372. They still use the raw RGB codes when scaling the image, so the code for black is interpreted as a positive color.Decode RGB with the XR conversion
(channel - 384) / 510before the existing capture scaling. The other 10:10:10:2 formats keep their original interpretation.The same synthetic format-89 pixel with all three channels at code
384produced white on940d32fand black with the fix. The[894, 639, 384]control produces[255, 127, 0]in the diagnostic image. All three capture tests, strict GPU diagnostics Clippy, and staged asset policy passed on Windows.Microsoft XR conversion rules · 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 Marvisak on 2026-11-25T15:56:30Z.
Automated triage for the maintainers. Merge candidate: in
crates/victory-gpu/src/capture.rs,to_rgbanow decodesR10G10B10_XR_BIAS_A2(format 89) channels as(code - 384) / 510before scaling, and leaves the other 10:10:10:2 formats alone. On main, colour formats scale fromlow = 0, so the raw code 384 that means black showed up as a bright colour. The conversion matches the public XR-bias rules linked in the PR, and the change only touches diagnostic captures. CI (check) passes.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T00:52:44Z.
Code review and RTX 5090 + WARP verification at head
c9f7f75ac70fmerged cleanly ontomain(63bcca43c6a0):crates/victory-gpu/src/capture.rs:659-668, 699-725):89(DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM) via(channel - 384.0) / 510.0before scaling matches the DXGI spec (384 -> 0.0,894 -> 1.0,[-0.752941, +1.252941]) while leaving23..=25untouched.low = 0.0,high = p99of non-zeroabs,.clamp(0.0, 1.0)) cleanly clamps negative extended values< 384to0and avoids division by zero on all-negative images; verified the updated green-channel expectation (50) matches((511-384)/510) / ((1023-384)/510) * 255.VICTORY_D3D12_DEBUG=1, Rust 1.98.1):cargo xtask policy:191 files ok;cargo clippy -p victory-gpu --all-targets --locked -- -D warnings(default +--features diagnostics): 0 warningsvictory-gpu --lib --features diagnostics capture: 12/12 passed on both RTX 5090 and WARP (includingxr_bias_targets_decode_black_and_extended_range_channels).LGTM.
Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-27T00:58:35Z.
Independent local verification of PR #2516 (GPU: decode XR-biased RGB before scaling diagnostic captures).
Windows, rustc/cargo 1.100.0/MSVC, worktree-local
CARGO_TARGET_DIR=D:\Victory-Contrib\target-2516-watch,CARGO_BUILD_JOBS=2,cargo test --locked, synthetic pixel only, no game data.cargo test --locked -p victory-gpu --lib --features diagnostics -- capture::tests::xr_bias_targets_decode_black_and_extended_range_channels --exact --test-threads=1 --quiet->test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 148 filtered out, exit 0.--features diagnosticsis required becausemod captureis gated by#[cfg(all(windows, feature = "diagnostics"))]incrates/victory-gpu/src/lib.rs:21-22.git diff --check 940d32f HEAD(merge base) clean; diff is 1 file (+22/-2),crates/victory-gpu/src/capture.rs.xr_bias_targets_decode_black_and_extended_range_channelsis absent from merge base940d32fviagit grep.origin/main(63bcca4) flags an unrelated blank line at EOF incrates/victory-formats/src/xma/tables.rs; this is not from this PR.Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T01:39:13Z.
I checked this exact head
c9f7f75ac70fd774c78426e95cd399b743e8590ewith #3639 ate0b5e8f7fbbea890f9a41ec95242305444e6c6e1on63bcca43. Git merged the two changes cleanly into tree6416920c75ab2ed8c8636a98b95df57d133700a4.I compiled the capture conversion and its tests directly from that tree using the cached
tracingand Windows crates. All 14 tests passed, covering XR black, nominal white and midtone, as well as the four signed R8/R16 capture formats. This verifies the CPU conversion with generated rows. The current PR already contains the XR fix and regression.Please preserve the Git author on cherry-pick or rebase, or include this trailer if folding the change into another commit.
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>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.