Decode packed 16-bit BGR surfaces in diagnostic captures #7

Open
github-bot wants to merge 1 commit from github-bot/gh-7 into main AGit
Owner

@⁠Yoshi-233 on GitHub · 2026-11-26 07:50 UTC · original
Yoshi-233:fix/capture-packed-bgr → main · +50 −4 · 1 files · 1 commits · open

The diagnostic target dump silently skips DXGI formats 85 (B5G6R5), 86 (B5G5R5A1), and 115 (B4G4R4A4) because capture::to_rgba returns None. Convert each packed little-endian word into the RGB channels used by the PNG writer and respect the readback row pitch. This affects captures of surfaces in these actual formats. It doesn't change the runtime's render-target substitutions.

I ported my previous fix and test and ran the comparison on this fork's f4b48ad and the patched source. A Linux CPU harness built the actual conversion and PNG writer from each revision. Base skipped all nine fixtures. The patch matched an independent RGBA reference across all 65,536 words for each format, padded rows and a one-pixel target. Reading the nine PNGs back independently with Pillow matched all 49,539 RGB pixels. All three capture-module tests passed in the harness.

Rust 1.98.1 also passed cargo check --locked --target x86_64-pc-windows-gnu -p victory-gpu --all-targets --features diagnostics. These tests used generated buffers; I did not run this fork on a Windows GPU.

**@⁠Yoshi-233** on GitHub · 2026-11-26 07:50 UTC · [original](https://github.com/codec-d/cool_fox/pull/7) `Yoshi-233:fix/capture-packed-bgr` → `main` · +50 −4 · 1 files · 1 commits · open The diagnostic target dump silently skips DXGI formats 85 (B5G6R5), 86 (B5G5R5A1), and 115 (B4G4R4A4) because `capture::to_rgba` returns `None`. Convert each packed little-endian word into the RGB channels used by the PNG writer and respect the readback row pitch. This affects captures of surfaces in these actual formats. It doesn't change the runtime's render-target substitutions. I ported my [previous fix and test](https://github.com/fxceless/victory-fork/pull/910) and ran the comparison on this fork's `f4b48ad` and the patched source. A Linux CPU harness built the actual conversion and PNG writer from each revision. Base skipped all nine fixtures. The patch matched an independent RGBA reference across all 65,536 words for each format, padded rows and a one-pixel target. Reading the nine PNGs back independently with Pillow matched all 49,539 RGB pixels. All three capture-module tests passed in the harness. Rust 1.98.1 also passed `cargo check --locked --target x86_64-pc-windows-gnu -p victory-gpu --all-targets --features diagnostics`. These tests used generated buffers; I did not run this fork on a Windows GPU.
Port the RGB-dump format support and padded-row regression from Yoshi-233 in fxceless/victory-fork@9bf4a0f.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 07:53:22 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/7/head:github-bot/gh-7'
git switch 'github-bot/gh-7'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-7'
git switch 'github-bot/gh-7'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-7'
git switch 'github-bot/gh-7'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-7'
git switch 'main'
git merge --squash 'github-bot/gh-7'
git switch 'main'
git merge --ff-only 'github-bot/gh-7'
git switch 'main'
git merge 'github-bot/gh-7'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.