Compose test: an sRGB BGRX plane gets the plain UNORM view, as every sRGB plane does since 95f6ef0f #2646

Open
boraswim wants to merge 1 commit from upstream-pr/2646 into main
boraswim commented 2026-11-29 15:31:47 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by boraswim on 2026-11-29T15:31:47Z.


Part of #2420 (item 3).

What it changes

compose::tests::bgrx_plane_selects_a_typed_view fails deterministically in the diagnostics build:

assertion `left == right` failed
  left: Some(DXGI_FORMAT(88))   // B8G8R8X8_UNORM
 right: Some(DXGI_FORMAT(93))   // B8G8R8X8_UNORM_SRGB

The code is right and the test is stale:

  • 95f6ef0f (Nov 26), "Two planes: read sRGB planes as plain UNORM so the scene's bytes reach the screen unchanged", made view() map sRGB planes to their plain UNORM view (27 | 29, 90 | 91).
  • 29473fb (Nov 28), "Compose BGRX scene planes through their legal sampled views", added BGRX and this test on a base without that rule, so the test expected the sRGB view to be kept (93 => 93).
  • The merge that brought both in (7bd42af) gave BGRX the same rule as the others (92 | 93 => B8G8R8X8_UNORM), and the doc comment on view() says so, but the test kept its old expectation.

The module's tests are #[cfg(all(test, feature = "diagnostics"))] and the diagnostics build has not compiled since the wave merges (#2048, #2208), so nobody saw the failure. The test now expects the rule, and checks the BGRA and RGBA sRGB planes too, so the rule is pinned for all three. Test-only.

How it was tested

  • GPU and profile: unit tests only (Windows 11, rustc 1.98.1, RTX 4070 SUPER; the GPU composite tests in the module ran on the card)
  • Before: cargo test -p victory-gpu --lib --features diagnostics -- compose:: fails bgrx_plane_selects_a_typed_view
  • After: 6 passed, 0 failed (with the diagnostics-build fix from #2048 applied, since main's diag build does not compile)
  • For shader changes, the wave sizes tested: not a shader change
  • cargo test passed for the crates it touches: yes, as above. CI does not run the diagnostics tests.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #2420 (the issue). #2048 and #2208 make the diag build compile. #1727 and #605 touch compose.rs but not view() or this test.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5552217245 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2646). Originally posted by [boraswim](https://github.com/boraswim) on 2026-11-29T15:31:47Z. --- Part of #2420 (item 3). ## What it changes `compose::tests::bgrx_plane_selects_a_typed_view` fails deterministically in the diagnostics build: ``` assertion `left == right` failed left: Some(DXGI_FORMAT(88)) // B8G8R8X8_UNORM right: Some(DXGI_FORMAT(93)) // B8G8R8X8_UNORM_SRGB ``` The code is right and the test is stale: - 95f6ef0f (Nov 26), "Two planes: read sRGB planes as plain UNORM so the scene's bytes reach the screen unchanged", made `view()` map sRGB planes to their plain UNORM view (`27 | 29`, `90 | 91`). - 29473fb (Nov 28), "Compose BGRX scene planes through their legal sampled views", added BGRX and this test on a base without that rule, so the test expected the sRGB view to be kept (`93 => 93`). - The merge that brought both in (7bd42af) gave BGRX the same rule as the others (`92 | 93 => B8G8R8X8_UNORM`), and the doc comment on `view()` says so, but the test kept its old expectation. The module's tests are `#[cfg(all(test, feature = "diagnostics"))]` and the diagnostics build has not compiled since the wave merges (#2048, #2208), so nobody saw the failure. The test now expects the rule, and checks the BGRA and RGBA sRGB planes too, so the rule is pinned for all three. Test-only. ## How it was tested - GPU and profile: unit tests only (Windows 11, rustc 1.98.1, RTX 4070 SUPER; the GPU composite tests in the module ran on the card) - Before: `cargo test -p victory-gpu --lib --features diagnostics -- compose::` fails `bgrx_plane_selects_a_typed_view` - After: 6 passed, 0 failed (with the diagnostics-build fix from #2048 applied, since main's diag build does not compile) - For shader changes, the wave sizes tested: not a shader change - `cargo test` passed for the crates it touches: yes, as above. CI does not run the diagnostics tests. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #2420 (the issue). #2048 and #2208 make the diag build compile. #1727 and #605 touch `compose.rs` but not `view()` or this test.
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/2646:upstream-pr/2646'
git switch 'upstream-pr/2646'

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