GPU capture: decode XR-biased RGB before image scaling #2516
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!2516
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@andrewpozdnakov7-jpg on GitHub · 2026-11-25 15:10 UTC · original
andrewpozdnakov7-jpg:codex2/capture-xr-bias→main· +22 −2 · 1 files · 1 commits · openCapture 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.
@Marvisak on GitHub · 2026-11-25 15:56 UTC · original
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
@fuzeofficlal on GitHub · 2026-11-26 00:52 UTC · original
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.
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.