GPU: detect black frames on half-float presentation #3687

Open
andrewpozdnakov7-jpg wants to merge 1 commit from upstream-pr/3687 into main
andrewpozdnakov7-jpg commented 2026-11-28 06:54:01 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T06:54:01Z.


The presenter accepts half-float color, but the black-frame probe skipped it. Sample R16G16B16A16_FLOAT and its typeless family as FP16. Ignore alpha and scale positive RGB to the existing 8-bit diagnostic range, with black below 8.

Using the normal presentation path on WARP, main reported four nonblack frames for opaque black, near-black red, green at level 8 and bright blue. At this head, FP16 and TYPELESS with an FP16 view both reported [black, black, nonblack, nonblack]. The RGBA8 control reported the same expected sequence. Each format was tested in a separate process with the D3D12 debug switch enabled. The committed unit test also checks negative and NaN channels, highlight clipping and BGRA8.

Strict GPU Clippy and the asset policy passed. The test used generated color textures on app-local WARP 1.0.22 and Agility 1.620.2.

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:5537632931 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3687). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T06:54:01Z. --- The presenter accepts half-float color, but the black-frame probe skipped it. Sample `R16G16B16A16_FLOAT` and its typeless family as FP16. Ignore alpha and scale positive RGB to the existing 8-bit diagnostic range, with black below 8. Using the normal presentation path on WARP, main reported four nonblack frames for opaque black, near-black red, green at level 8 and bright blue. At this head, FP16 and TYPELESS with an FP16 view both reported `[black, black, nonblack, nonblack]`. The RGBA8 control reported the same expected sequence. Each format was tested in a separate process with the D3D12 debug switch enabled. The committed unit test also checks negative and NaN channels, highlight clipping and BGRA8. Strict GPU Clippy and the asset policy passed. The test used generated color textures on app-local WARP 1.0.22 and Agility 1.620.2. 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 06:57:31 +00:00 (Migrated from github.com)

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


Windows CI passed at 3e91c42, including Clippy on both build configurations and the repository test job. The FP16, typeless and RGBA8 WARP checks in the description apply to this head. I also checked the combined decoder for both sets of formats in #2962.

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:7235623883 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3687#issuecomment-7235623883). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T06:57:31Z. --- [Windows CI](https://github.com/Marvisak/VIctory/actions/runs/46118724068/job/140898254569) passed at `3e91c42`, including Clippy on both build configurations and the repository test job. The FP16, typeless and RGBA8 WARP checks in the description apply to this head. I also checked the combined decoder for both sets of formats in [#2962](https://github.com/Marvisak/VIctory/pull/2962#issuecomment-7235613496). 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 11:23:11 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-28T11:23:11Z.


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

  • PR #3687 at head 3e91c421582ec5ccf10cf3c7c4701ece909fccae, base/parent 63bcca43c6a00a758510398fa43096ce7e4f7df0.
  • The capture module is gated #[cfg(all(windows, feature = "diagnostics"))], so the default build replays 0 tests; with the feature enabled: cargo test --locked -p victory-gpu --lib --features diagnostics -- capture::black_probe_uses_the_same_level_scale_for_float_and_byte_color --exact --test-threads=1 --quiet → 1 passed, 0 failed, 247 filtered, exit 0.
  • 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, +56/-10).
  • Used a per-worktree CARGO_TARGET_DIR (never shared) with CARGO_BUILD_JOBS=2; two pre-existing warnings in the victory-gpu lib test build (unrelated to this change).
  • Only the named synthetic test was replayed; full workspace suite and clippy were not run locally.
  • GPU/driver: N/A (CPU-only half-float/byte level-scaling assertions). No game data, assets, extracted shaders, DRM or decrypt involved.

AI-assisted (Hy4 flash).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7238516125 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3687#issuecomment-7238516125). Originally posted by [cloph-dsp](https://github.com/cloph-dsp) on 2026-11-28T11:23:11Z. --- Independent local verification (Windows, Rust 1.100.0/MSVC, no game data): - PR #3687 at head `3e91c421582ec5ccf10cf3c7c4701ece909fccae`, base/parent `63bcca43c6a00a758510398fa43096ce7e4f7df0`. - The `capture` module is gated `#[cfg(all(windows, feature = "diagnostics"))]`, so the default build replays 0 tests; with the feature enabled: `cargo test --locked -p victory-gpu --lib --features diagnostics -- capture::black_probe_uses_the_same_level_scale_for_float_and_byte_color --exact --test-threads=1 --quiet` → 1 passed, 0 failed, 247 filtered, exit 0. - `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, +56/-10). - Used a per-worktree `CARGO_TARGET_DIR` (never shared) with `CARGO_BUILD_JOBS=2`; two pre-existing warnings in the victory-gpu lib test build (unrelated to this change). - Only the named synthetic test was replayed; full workspace suite and clippy were not run locally. - GPU/driver: N/A (CPU-only half-float/byte level-scaling assertions). 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/3687:upstream-pr/3687'
git switch 'upstream-pr/3687'

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