GPU capture: save half-float presentation frames #3689

Open
andrewpozdnakov7-jpg wants to merge 1 commit from upstream-pr/3689 into main
andrewpozdnakov7-jpg commented 2026-11-28 07:04:31 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T07:04:31Z.


FP16 frames now produce the usual half-size RGB PNG during VICTORY_CAPTURE. The export interprets FLOAT and TYPELESS presentation pixels as half floats, ignores alpha, and maps the fixed range 0–1 to 0–255. This keeps black, midtones and clipped highlights comparable across captured frames.

On Windows with signed app-local WARP 1.0.22 and Agility 1.620.2, the normal presentation path on main wrote no PNG for either FP16 frame. The same fixture at this head exported both a black frame and a frame with RGB [64, 128, 255] for FLOAT and TYPELESS. An independent PNG decoder checked all pixels, dimensions and chunk CRCs. The RGBA8 and BGRA8 PNGs matched main byte for byte.

The checked-in test covers mixed FP16 values, padded rows and nonfinite channels. Strict GPU Clippy and the asset policy passed.

Please retain the Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding the change into another commit.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:issue:5537703137 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3689). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T07:04:31Z. --- FP16 frames now produce the usual half-size RGB PNG during `VICTORY_CAPTURE`. The export interprets FLOAT and TYPELESS presentation pixels as half floats, ignores alpha, and maps the fixed range 0–1 to 0–255. This keeps black, midtones and clipped highlights comparable across captured frames. On Windows with signed app-local WARP 1.0.22 and Agility 1.620.2, the normal presentation path on main wrote no PNG for either FP16 frame. The same fixture at this head exported both a black frame and a frame with RGB `[64, 128, 255]` for FLOAT and TYPELESS. An independent PNG decoder checked all pixels, dimensions and chunk CRCs. The RGBA8 and BGRA8 PNGs matched main byte for byte. The checked-in test covers mixed FP16 values, padded rows and nonfinite channels. Strict GPU Clippy and the asset policy passed. Please retain the Git author on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding the change into another commit. AI-assisted with OpenAI Codex.
andrewpozdnakov7-jpg commented 2026-11-28 07:07:44 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T07:07:44Z.


Windows CI passed at 9872963, including Clippy on both build configurations and the repository test job. The FP16 PNG readbacks and byte-identical 8-bit controls in the description apply to this head. The shared writer also passed the seven-format presentation check in #2827.

The next step is maintainer review.

Please retain the Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding this change into another commit.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7235734053 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3689#issuecomment-7235734053). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T07:07:44Z. --- [Windows CI](https://github.com/Marvisak/VIctory/actions/runs/46119506011/job/140900679023) passed at `9872963`, including Clippy on both build configurations and the repository test job. The FP16 PNG readbacks and byte-identical 8-bit controls in the description apply to this head. The shared writer also passed the seven-format presentation check in [#2827](https://github.com/Marvisak/VIctory/pull/2827#issuecomment-7235728790). The next step is maintainer review. Please retain the Git author on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding this change into another commit. AI-assisted with OpenAI Codex.
cloph-dsp commented 2026-11-28 13:10:31 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-28T13:10:31Z.


Independent local verification (Windows, Rust 1.100.0/MSVC, no game data):

  • PR #3689 at head 98729637a0e091eabf222e8a81a963b207a217d7, base/parent 63bcca43c6a00a758510398fa43096ce7e4f7df0.
  • cargo test --locked -p victory-gpu --lib --features diagnostics -- capture::tests::half_float_frames_are_saved_with_a_fixed_rgb_scale --exact --test-threads=1 --quiet → 1 passed, 0 failed, 247 filtered, exit 0. The diagnostics feature is required because mod capture is cfg-gated on all(windows, feature = "diagnostics"); the build emitted 2 pre-existing warnings.
  • git grep -F for the test name on the base returned no match (test is new on this PR); git diff --check 63bcca4 HEAD clean (1 file, +92/-29).
  • Used a per-worktree CARGO_TARGET_DIR (never shared) with CARGO_BUILD_JOBS=2.
  • Only the named synthetic test was replayed; the full workspace suite and clippy were not run locally.
  • GPU/driver: N/A (CPU-only PNG capture test). No game data, assets, extracted shaders, DRM or decrypt involved.

AI-assisted (Hy4 flash).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7239747321 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3689#issuecomment-7239747321). Originally posted by [cloph-dsp](https://github.com/cloph-dsp) on 2026-11-28T13:10:31Z. --- Independent local verification (Windows, Rust 1.100.0/MSVC, no game data): - PR #3689 at head `98729637a0e091eabf222e8a81a963b207a217d7`, base/parent `63bcca43c6a00a758510398fa43096ce7e4f7df0`. - `cargo test --locked -p victory-gpu --lib --features diagnostics -- capture::tests::half_float_frames_are_saved_with_a_fixed_rgb_scale --exact --test-threads=1 --quiet` → 1 passed, 0 failed, 247 filtered, exit 0. The `diagnostics` feature is required because `mod capture` is cfg-gated on `all(windows, feature = "diagnostics")`; the build emitted 2 pre-existing warnings. - `git grep -F` for the test name on the base returned no match (test is new on this PR); `git diff --check 63bcca4 HEAD` clean (1 file, +92/-29). - Used a per-worktree `CARGO_TARGET_DIR` (never shared) with `CARGO_BUILD_JOBS=2`. - Only the named synthetic test was replayed; the full workspace suite and clippy were not run locally. - GPU/driver: N/A (CPU-only PNG capture test). No game data, assets, extracted shaders, DRM or decrypt involved. AI-assisted (Hy4 flash).
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/3689:upstream-pr/3689'
git switch 'upstream-pr/3689'

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/3689'
git switch 'upstream-pr/3689'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3689'
git switch 'upstream-pr/3689'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3689'
git switch 'main'
git merge --squash 'upstream-pr/3689'
git switch 'main'
git merge --ff-only 'upstream-pr/3689'
git switch 'main'
git merge 'upstream-pr/3689'
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!3689
No description provided.