Capture: R16G16B16A16_UNORM targets are integers, format 89 is 10:10:10:2 #372

Manually merged
github merged 1 commit from gh-pr/372/head into gh-pr/372/base 2026-11-26 04:01:26 +00:00
Owner

@⁠marquezinii on GitHub · 2026-11-24 02:43 UTC · original
marquezinii:fix/capture-unorm16-formats → main · +19 −3 · 1 files · 1 commits · merged 2026-11-24 08:06 UTC

Two DXGI formats came out of VICTORY_CAPTURE / VICTORY_DUMP_TARGETS dumps wrong:

  • 9..=11 were all decoded as half floats, but 11 is R16G16B16A16_UNORM. A UNORM 0x8000 read as half -0 and 0xffff as -inf (then dropped as not finite), so such targets dumped mostly black. 11..=14 (UNORM, UINT, SNORM, SINT) now read as 16-bit integers, as the R16G16_* arm (35..=38) already does.
  • 87..=93 were all swapped as 8-bit BGRA, but 89 is R10G10B10_XR_BIAS_A2_UNORM. It now goes through the 10:10:10:2 arm with 23..=25.

Tested with a new unit test on to_rgba (cargo test -p victory-gpu --features diagnostics --lib capture): a UNORM16 pixel with red 0x8000 and green 0x4000 gave [0, 255, 0, 255] before and gives [255, 127, 0, 255] now; format 89 and plain BGRA8 are checked too. Clippy with diagnostics is clean. Not tried on a real capture.

**@⁠marquezinii** on GitHub · 2026-11-24 02:43 UTC · [original](https://github.com/Marvisak/VIctory/pull/372) `marquezinii:fix/capture-unorm16-formats` → `main` · +19 −3 · 1 files · 1 commits · merged 2026-11-24 08:06 UTC Two DXGI formats came out of `VICTORY_CAPTURE` / `VICTORY_DUMP_TARGETS` dumps wrong: - 9..=11 were all decoded as half floats, but 11 is `R16G16B16A16_UNORM`. A UNORM 0x8000 read as half -0 and 0xffff as -inf (then dropped as not finite), so such targets dumped mostly black. 11..=14 (UNORM, UINT, SNORM, SINT) now read as 16-bit integers, as the `R16G16_*` arm (35..=38) already does. - 87..=93 were all swapped as 8-bit BGRA, but 89 is `R10G10B10_XR_BIAS_A2_UNORM`. It now goes through the 10:10:10:2 arm with 23..=25. Tested with a new unit test on `to_rgba` (`cargo test -p victory-gpu --features diagnostics --lib capture`): a UNORM16 pixel with red 0x8000 and green 0x4000 gave `[0, 255, 0, 255]` before and gives `[255, 127, 0, 255]` now; format 89 and plain BGRA8 are checked too. Clippy with `diagnostics` is clean. Not tried on a real capture.
Frame dumps decoded DXGI format 11 (R16G16B16A16_UNORM) as half floats,
so 0x8000 came out as -0 and 0xffff as -inf, and 12-14 were not handled.
Format 89 (R10G10B10_XR_BIAS_A2_UNORM) went through the B8G8R8A8 swap.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:01:24 +00:00
github manually merged commit 0f369d660c into gh-pr/372/base 2026-11-26 04:01:26 +00:00
Author
Owner

@⁠jeremygold02 on GitHub · 2026-11-24 04:08 UTC · original

Thanks @⁠marquezinii for correcting these capture format cases. I tested head 0f369d660c9e5ace8482f2f9cc5572c9805e9416 with:

cargo test --locked -p victory-gpu --features diagnostics --lib unorm16_and_xr_bias_targets_decode_as_their_formats -- --test-threads=1

Result: 1 passed, 0 failed (46 filtered out). The synthetic to_rgba cases check R16G16B16A16_UNORM, format 89 as 10:10:10:2, and ordinary BGRA8 output. This validates the CPU decoder; it does not exercise a live GPU capture.

**@⁠jeremygold02** on GitHub · 2026-11-24 04:08 UTC · [original](https://github.com/Marvisak/VIctory/pull/372#issuecomment-7121741363) Thanks @⁠marquezinii for correcting these capture format cases. I tested head `0f369d660c9e5ace8482f2f9cc5572c9805e9416` with: ``` cargo test --locked -p victory-gpu --features diagnostics --lib unorm16_and_xr_bias_targets_decode_as_their_formats -- --test-threads=1 ``` Result: 1 passed, 0 failed (46 filtered out). The synthetic `to_rgba` cases check R16G16B16A16_UNORM, format 89 as 10:10:10:2, and ordinary BGRA8 output. This validates the CPU decoder; it does not exercise a live GPU capture.
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!372
No description provided.