Decode packed 16-bit BGR targets in diagnostic captures #104

Manually merged
github merged 1 commit from github-bot/gh-104 into main 2026-11-26 08:21:46 +00:00 AGit
Owner

@⁠Yoshi-233 on GitHub · 2026-11-26 03:29 UTC · original
Yoshi-233:fix/diagnostic-packed-bgr → main · +50 −4 · 1 files · 1 commits · merged 2026-11-26 08:17 UTC

The diagnostic target dumper currently skips B5G6R5, B5G5R5A1 and B4G4R4A4 before it writes a PNG. Decode their little-endian 16-bit words using the full range of each RGB channel. Keep alpha opaque, as for the other color paths. The added 2×2 regression test includes row padding and mixed channel values.

This ports the conversion from fxceless/victory-fork#910. The resulting to_rgba function is byte-for-byte identical to the one tested at 9bf4a0f there. On that revision I uploaded and read back synthetic textures on an RTX 4070 Ti SUPER on Windows. The wider comparison in the linked PR also covers Intel UHD 770 and WARP. The output here follows nearest-integer UNORM expansion; a physical device sampling the format in a typed shader can round a channel differently by one.

Checks on this fork

  • On Linux I compiled the real conversion and PNG-writing functions from base e2a28ec and from this branch in a CPU harness. All nine fixtures were skipped on base. With the patch, each format passed the complete 65,536-word sweep plus padded 129×5 and 1×1 images. All decoded RGBA pixels matched an independent reference. I reopened all nine half-size PNGs from this fork’s own save_as and compared every sampled RGB pixel.
  • The three capture unit tests passed in the harness. Rust 1.98.1 passed cargo check --locked --target x86_64-pc-windows-gnu -p victory-gpu --all-targets --features diagnostics and the staged asset check. I have not run the AvatarManz binary on Windows with this change.

AI-assisted port and regression checks.

**@⁠Yoshi-233** on GitHub · 2026-11-26 03:29 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/104) `Yoshi-233:fix/diagnostic-packed-bgr` → `main` · +50 −4 · 1 files · 1 commits · merged 2026-11-26 08:17 UTC The diagnostic target dumper currently skips B5G6R5, B5G5R5A1 and B4G4R4A4 before it writes a PNG. Decode their little-endian 16-bit words using the full range of each RGB channel. Keep alpha opaque, as for the other color paths. The added 2×2 regression test includes row padding and mixed channel values. This ports the conversion from [fxceless/victory-fork#910](https://github.com/fxceless/victory-fork/pull/910). The resulting `to_rgba` function is byte-for-byte identical to the one tested at `9bf4a0f` there. On that revision I uploaded and read back synthetic textures on an RTX 4070 Ti SUPER on Windows. The wider comparison in the linked PR also covers Intel UHD 770 and WARP. The output here follows nearest-integer UNORM expansion; a physical device sampling the format in a typed shader can round a channel differently by one. **Checks on this fork** - On Linux I compiled the real conversion and PNG-writing functions from base `e2a28ec` and from this branch in a CPU harness. All nine fixtures were skipped on base. With the patch, each format passed the complete 65,536-word sweep plus padded 129×5 and 1×1 images. All decoded RGBA pixels matched an independent reference. I reopened all nine half-size PNGs from this fork’s own `save_as` and compared every sampled RGB pixel. - The three capture unit tests passed in the harness. Rust 1.98.1 passed `cargo check --locked --target x86_64-pc-windows-gnu -p victory-gpu --all-targets --features diagnostics` and the staged asset check. I have not run the AvatarManz binary on Windows with this change. AI-assisted port and regression checks.
Backport the capture conversion and regression test from fxceless/victory-fork#910.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:32:15 +00:00
Author
Owner

@⁠avatarmanz on GitHub · 2026-11-26 07:55 UTC · original

Merged into main in the next push (tests pass); thanks.

**@⁠avatarmanz** on GitHub · 2026-11-26 07:55 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/104#issuecomment-7185979691) Merged into main in the next push (tests pass); thanks.
github manually merged commit dfeabb1490 into main 2026-11-26 08:21:45 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.