GPU capture: decode R32G32_UINT targets #2525

Open
andrewpozdnakov7-jpg wants to merge 1 commit from upstream-pr/2527 into main
andrewpozdnakov7-jpg commented 2026-11-25 15:19:02 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-25T15:19:02Z.


VICTORY_DUMP_TARGETS can read back an R32G32_UINT texture, but the PNG conversion has no decoder for the format. As a result, it logs target not dumped: format even if the readback succeeded.

Decode both 32-bit channels as unsigned integers, with blue set to zero, then apply the existing diagnostic scaling.

The same two synthetic rows are unsupported on 940d32f and produce [255, 127, 0, 255] and [0, 255, 0, 255] with the change. Both rows contain values at or above the signed 32-bit boundary and unused padding with u32::MAX, so the test also checks unsigned interpretation and row pitch. All three capture tests, strict GPU diagnostics Clippy, and staged asset policy passed on Windows.

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.

<!-- greyfinch-sync:Marvisak/VIctory:issue:5494131823 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2527). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-25T15:19:02Z. --- `VICTORY_DUMP_TARGETS` can read back an `R32G32_UINT` texture, but the PNG conversion has no decoder for the format. As a result, it logs `target not dumped: format` even if the readback succeeded. Decode both 32-bit channels as unsigned integers, with blue set to zero, then apply the existing diagnostic scaling. The same two synthetic rows are unsupported on `940d32f` and produce `[255, 127, 0, 255]` and `[0, 255, 0, 255]` with the change. Both rows contain values at or above the signed 32-bit boundary and unused padding with `u32::MAX`, so the test also checks unsigned interpretation and row pitch. All three capture tests, strict GPU diagnostics Clippy, and staged asset policy passed on Windows. [Coordination claim](https://github.com/Marvisak/VIctory/issues/1633#issuecomment-7166526480) 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 commented 2026-11-25 19:06:22 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T18:32:31Z.


Automated triage for the maintainers.

Merge candidate (small). In capture::to_rgba (crates/victory-gpu/src/capture.rs), this adds format 17 (R32G32_UINT). Its two channels are read as unsigned integers with an 8-byte stride, next to the existing R32G32_FLOAT arm (15..=16), so diagnostic captures of such targets are no longer skipped. I checked the new test's expected bytes by hand against the 99th-percentile scaling and the row pitch: they match. It only affects diagnostic captures. CI: passing.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7171048799 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2527#issuecomment-7171048799). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T18:32:31Z. --- <!-- victory-triage v1 head=557650c49285fbf690c344e4d82ada9b14b6c5e5 verdict=merge-candidate at=2026-11-25T18:32:20Z --> Automated triage for the maintainers. **Merge candidate (small).** In `capture::to_rgba` (`crates/victory-gpu/src/capture.rs`), this adds format 17 (`R32G32_UINT`). Its two channels are read as unsigned integers with an 8-byte stride, next to the existing `R32G32_FLOAT` arm (15..=16), so diagnostic captures of such targets are no longer skipped. I checked the new test's expected bytes by hand against the 99th-percentile scaling and the row pitch: they match. It only affects diagnostic captures. CI: passing. --- _Generated by [Claude Code](https://claude.ai/code)_
futurepro62 commented 2026-11-26 01:04:20 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by futurepro62 on 2026-11-26T01:02:27Z.


Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head 557650c (on its base 940d32f).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), dxil.dll from Windows SDK 10.0.26100 (the loader's default), debug.
  • cargo build --workspace --locked, then cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 696 passed, 0 failed, 10 ignored.
  • rg32_uint_channels_are_unsigned_and_skip_padding only builds with the diagnostics feature, so the run above doesn't include it; it passes in cargo test -p victory-gpu --lib --locked --features diagnostics (same skips).
  • --skip leaves out tests that fail on main 63bcca4 on this card too, not because of this PR: heap_direct_texture_reads_mark_their_heap_index ends the victory-shader test process with 0xc0000005 (#2571), so without the skip the rest of that crate never reports; dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views and the two stride_tests hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); gathers_at_a_level_match_the_hardware fails on lane 0 (#1744).

Not tested

  • AMD (the tests take the default adapter), a release build, the title (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7179368318 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2527#issuecomment-7179368318). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-26T01:02:27Z. --- Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head `557650c` (on its base `940d32f`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), `dxil.dll` from Windows SDK 10.0.26100 (the loader's default), debug. - `cargo build --workspace --locked`, then `cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware`: **696 passed, 0 failed, 10 ignored**. - `rg32_uint_channels_are_unsigned_and_skip_padding` only builds with the `diagnostics` feature, so the run above doesn't include it; it passes in `cargo test -p victory-gpu --lib --locked --features diagnostics` (same skips). - `--skip` leaves out tests that fail on main `63bcca4` on this card too, not because of this PR: `heap_direct_texture_reads_mark_their_heap_index` ends the `victory-shader` test process with `0xc0000005` (#2571), so without the skip the rest of that crate never reports; `dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views` and the two `stride_tests` hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); `gathers_at_a_level_match_the_hardware` fails on lane 0 (#1744). **Not tested** - AMD (the tests take the default adapter), a release build, the title (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
fuzeofficlal commented 2026-11-26 02:10:49 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T02:10:49Z.

Review: COMMENTED


Reviewed and verified against main (63bcca43) on Windows 11 — clean and ready to merge:

  • Adds DXGI_FORMAT_R32G32_UINT (format 17) 8-bpp unsigned decoding in capture.rs:to_rgba with proper row-pitch handling and a regression test covering 0x8000_0000/0x4000_0000/u32::MAX and 12-byte padded pitch.

Local verification:

  • cargo test --locked -p victory-gpu --lib --features diagnostics -- capture::: 12/12 passed (including rg32_uint_channels_are_unsigned_and_skip_padding)
  • cargo clippy --all-targets -p victory-gpu -- -D warnings (default & --features diagnostics) + cargo xtask policy (191 files ok): 0 warnings
<!-- greyfinch-sync:Marvisak/VIctory:review:6067627150 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2527#pullrequestreview-6067627150). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T02:10:49Z. **Review:** COMMENTED --- Reviewed and verified against `main` (`63bcca43`) on Windows 11 — clean and ready to merge: - Adds `DXGI_FORMAT_R32G32_UINT` (format `17`) 8-bpp unsigned decoding in `capture.rs:to_rgba` with proper row-pitch handling and a regression test covering `0x8000_0000`/`0x4000_0000`/`u32::MAX` and 12-byte padded pitch. **Local verification**: - `cargo test --locked -p victory-gpu --lib --features diagnostics -- capture::`: **12/12 passed** (including `rg32_uint_channels_are_unsigned_and_skip_padding`) - `cargo clippy --all-targets -p victory-gpu -- -D warnings` (default & `--features diagnostics`) + `cargo xtask policy` (`191 files ok`): 0 warnings
cloph-dsp commented 2026-11-26 23:07:49 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-26T23:07:49Z.


Independent local verification of PR #2527 (557650c), from Windows with Rust 1.100.0/MSVC (repo pins 1.98.1) and per-worktree CARGO_TARGET_DIR, CARGO_BUILD_JOBS=2, no game data.

  • cargo test --locked -p victory-gpu --lib --features diagnostics -- --exact capture::tests::rg32_uint_channels_are_unsigned_and_skip_padding → test result: ok. 1 passed; 0 failed; 148 filtered out, exit 0. capture is gated behind #[cfg(all(windows, feature = "diagnostics"))], so --features diagnostics is required.
  • git diff --check against merge base 940d32f → clean (exit 0). Against current origin/main it flags an unrelated EOF blank line in crates/victory-formats/src/xma/tables.rs, not from this PR.
  • Negative control: git grep for rg32_uint_channels_are_unsigned_and_skip_padding on origin/main found no match, so the regression test is added by this PR.

This adds a Windows/MSVC 1.100 data point alongside the existing NVIDIA full-suite report. Only the synthetic capture unit test was replayed; no real GPU capture or title target was used. AI-assisted (Hy4 flash). GPU/driver: N/A for this CPU-only capture-decode test. No game data.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7205279550 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2527#issuecomment-7205279550). Originally posted by [cloph-dsp](https://github.com/cloph-dsp) on 2026-11-26T23:07:49Z. --- Independent local verification of PR #2527 (`557650c`), from Windows with Rust 1.100.0/MSVC (repo pins 1.98.1) and per-worktree `CARGO_TARGET_DIR`, `CARGO_BUILD_JOBS=2`, no game data. - `cargo test --locked -p victory-gpu --lib --features diagnostics -- --exact capture::tests::rg32_uint_channels_are_unsigned_and_skip_padding` → `test result: ok. 1 passed; 0 failed; 148 filtered out`, exit 0. `capture` is gated behind `#[cfg(all(windows, feature = "diagnostics"))]`, so `--features diagnostics` is required. - `git diff --check` against merge base `940d32f` → clean (exit 0). Against current `origin/main` it flags an unrelated EOF blank line in `crates/victory-formats/src/xma/tables.rs`, not from this PR. - Negative control: `git grep` for `rg32_uint_channels_are_unsigned_and_skip_padding` on `origin/main` found no match, so the regression test is added by this PR. This adds a Windows/MSVC 1.100 data point alongside the existing NVIDIA full-suite report. Only the synthetic capture unit test was replayed; no real GPU capture or title target was used. AI-assisted (Hy4 flash). GPU/driver: N/A for this CPU-only capture-decode test. No game data.
Dukestar69 commented 2026-11-26 23:28:02 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T23:28:02Z.

Review: APPROVED


LGTM — verified on Windows against origin/main (63bcca4).

  • Decoding R32G32_UINT diagnostic capture targets passes cleanly with both default and --features diagnostics builds.
  • cargo test -p victory-gpu --lib --features diagnostics capture:: -- --test-threads=1: all passed.
  • cargo clippy -p victory-gpu --all-targets -- -D warnings (default + --features diagnostics): clean.
  • cargo xtask policy: 191 files ok.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6081457753 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2527#pullrequestreview-6081457753). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-11-26T23:28:02Z. **Review:** APPROVED --- LGTM — verified on Windows against `origin/main` (`63bcca4`). - Decoding `R32G32_UINT` diagnostic capture targets passes cleanly with both default and `--features diagnostics` builds. - `cargo test -p victory-gpu --lib --features diagnostics capture:: -- --test-threads=1`: all passed. - `cargo clippy -p victory-gpu --all-targets -- -D warnings` (default + `--features diagnostics`): clean. - `cargo xtask policy`: 191 files ok. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2527:upstream-pr/2527'
git switch 'upstream-pr/2527'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/2527'
git switch 'upstream-pr/2527'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2527'
git switch 'upstream-pr/2527'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2527'
git switch 'main'
git merge --squash 'upstream-pr/2527'
git switch 'main'
git merge --ff-only 'upstream-pr/2527'
git switch 'main'
git merge 'upstream-pr/2527'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!2525
No description provided.