GPU: decode packed 16-bit UNORM diagnostic targets #2634
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2636"
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-25T17:20:26Z.
Problem
Diagnostic capture skips native B5G6R5_UNORM, B5G5R5A1_UNORM, and B4G4R4A4_UNORM readbacks because the PNG converter has no case for their format IDs.
Change
Decode and normalize each RGB channel by its own bit width before the existing diagnostic scaling. Alpha stays outside RGB scaling, including alpha-only pixels. The bit layouts match Microsoft's DirectXTex loader.
Verification
13f91ca. With this change, all three return the expected opaque RGBA bytes. Full white catches the different green width in B5G6R5, and the fixtures cover channel order, half green, nonzero row padding, and alpha-only pixels.Coordination claim
AI-assisted (Codex 2). Please retain the Git author on cherry-pick or rebase. If folding this change into another commit, please retain Co-authored-by: andrewpozdnakov7-jpg [email protected].
Imported from Marvisak/VIctory. Originally posted by Bj0rnis on 2026-11-25T17:33:48Z.
Independent Windows 11 hardware + WARP verification of #2636 at
1ef6c9b1(cleangit merge-treewithorigin/main13f91cae, Rust 1.98.1 MSVC):cargo test -p victory-gpu --features diagnostics --lib --locked -- --test-threads=1-> 197 passed, 2 failed, 1 ignored (2.86s; includes the new test, only the 2 pre-existing #1744 NVIDIA 1M view-heap baseline failures also present onmain13f91cae).VICTORY_D3D12_WARP=1): 199 passed, 0 failed, 1 ignored (1.73s).cargo clippy -p victory-gpu --all-targets --all-features --locked -- -D warnings-> 0 warnings.cargo xtask policy-> 184 files ok.Not tested: live game capture/target dump.
AI-assisted test run and summary.
Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-25T17:47:55Z.
Reviewed: ids and bit layouts check out — 85 B5G6R5 (R 11:5, G 5:6, B 0:5), 86 B5G5R5A1 (5 bits each from bit 10, alpha dropped per the comment), 115 B4G4R4A4 (4 bits each). Test covers all three plus row padding. CI green.
upstream-sync referenced this pull request2026-11-25 19:06:38 +00:00
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T22:22:25Z.
Automated triage for the maintainers.
Recommended for a maintainer's look. Diagnostic captures (
to_rgbaincrates/victory-gpu/src/capture.rs) returned nothing for the packed 16-bit formats 85 (B5G6R5), 86 (B5G5R5A1) and 115 (B4G4R4A4); they now decode each channel by its own width. I checked the shifts against the DXGI bit layouts (R at 11/10/8, G at 5/5/4, B at 0), and the green width of B5G6R5 is handled separately. Diagnostics-only, 12 lines plus a test that covers row padding. Merges cleanly into currentmain, CIcheckpassing on this head.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T05:08:12Z.
Review: APPROVED
Tested merged onto
origin/main(63bcca4) on Windows 11 x64:cargo test -p victory-gpu --features diagnostics --lib capture::: 12 passed, 0 failed (including newpacked_unorm_captures_decode_each_rgb_width).cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo clippy -p victory-gpu --all-targets --features diagnostics -- -D warnings: clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T16:52:35Z.
Review: APPROVED
Verified
e91de8a62b2ff4623dbadfdd532e59b18e4dde1dmerged cleanly onto63bcca43on Windows 11 with both an RTX 5090 and WARP (--features diagnostics,VICTORY_D3D12_DEBUG=1).Code review
to_rgba(crates/victory-gpu/src/capture.rs:659-670) match all three 16-bit packed UNORM layouts:85(DXGI_FORMAT_B5G6R5_UNORM):Rbits11..15(/ 31),Gbits5..10(/ 63),Bbits0..4(/ 31).86(DXGI_FORMAT_B5G5R5A1_UNORM):Rbits10..14,Gbits5..9,Bbits0..4(/ 31), alpha bit15ignored.115(DXGI_FORMAT_B4G4R4A4_UNORM):Rbits8..11,Gbits4..7,Bbits0..3(/ 15), alpha bits12..15ignored.B5G6R5's wider green channel before the existing p99 scaling path, and also merges cleanly alongside#2607with no textual conflict incapture.rs.Verification
cargo xtask policy:191 files ok.cargo clippy --locked -p victory-gpu --all-targets -- -D warnings(default and--all-features): clean.--features diagnostics,VICTORY_D3D12_DEBUG=1):capture::12 passed, 0 failed on both adapters (includingpacked_unorm_captures_decode_each_rgb_widthatcapture.rs:965).#2607plus an extra pixel probe covering pure R/G/B primaries and all-alpha-only images (0x8000for86,0xF000for115, verifying opaque black output with no scaling distortion or division by zero): 14 passed, 0 failed on both RTX 5090 and WARP.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.