D3D12.X: preserve the sRGB base with linear overlays #2811

Open
github-bot wants to merge 4 commits from github-bot/gh-2811 into main AGit
Owner

@⁠CryingLaughing on GitHub · 2026-11-26 14:07 UTC · original
CryingLaughing:fix/present-primary-srgb-transfer → main · +215 −84 · 2 files · 4 commits · open

Stacked on #2763, which follows #2537. The top commit 96b0b189fd0a8991c8e7883823191cf54d896223 is the change under review.

An UNORM overlay could force an sRGB scene to be stored as linear bytes. The primary plane already selects the SDR swap-chain format. Use it to select the compositor’s output transfer too, and keep each input plane’s own SRV format.

What is in it

  • Selects the 8-bit SDR output RTV and pipeline state from the opaque base plane in present.rs.
  • Extends the offscreen compositor regression to mixed input formats, including the reverse case where the base is UNORM.

Tested

  • Exact head 96b0b189fd0a8991c8e7883823191cf54d896223, with #2763 head 0d380f427797fb91a07512d074a5f6f4e1892674 as its parent. RTX 4080 driver 621.01, Core i5-13600K, Windows 11 25H2 build 26200.9974, Rust 1.100.0 x64 MSVC and DXC 1.8.2502.11, debug.
  • The WARP control on #2763 failed at the mixed-format assertion with [128,55,0,255]. The native RTX 4080 fixture on the new production revision passed 1/0/0 with no capability skips over five offscreen cases. With an sRGB base and transparent UNORM overlay, it read [188,128,0,255]. A fractional overlay read [137,161,0,255]. The reverse case read [0,64,127,255] for the fractional sample. The BGRA case also passed.
  • The exact portable compositor_blends_ui_plane_over_scene_plane test passed 1/0/0. cargo build --workspace --locked -j 4 succeeded. cargo test --workspace --locked -j 4 -- --test-threads=4 --show-output reported 1,436 passed, 0 failed, 47 ignored across 37 harnesses. The pass count includes 29 capability skips.

Regression run

Matched retail smoke runs on this head are pending.

Not tested

  • Physical display output, retail smoke on this head, and other GPU vendors.
**@⁠CryingLaughing** on GitHub · 2026-11-26 14:07 UTC · [original](https://github.com/xcl-dev/xcl/pull/2811) `CryingLaughing:fix/present-primary-srgb-transfer` → `main` · +215 −84 · 2 files · 4 commits · open Stacked on #2763, which follows #2537. The top commit `96b0b189fd0a8991c8e7883823191cf54d896223` is the change under review. An UNORM overlay could force an sRGB scene to be stored as linear bytes. The primary plane already selects the SDR swap-chain format. Use it to select the compositor’s output transfer too, and keep each input plane’s own SRV format. **What is in it** - Selects the 8-bit SDR output RTV and pipeline state from the opaque base plane in `present.rs`. - Extends the offscreen compositor regression to mixed input formats, including the reverse case where the base is UNORM. **Tested** - Exact head `96b0b189fd0a8991c8e7883823191cf54d896223`, with #2763 head `0d380f427797fb91a07512d074a5f6f4e1892674` as its parent. RTX 4080 driver 621.01, Core i5-13600K, Windows 11 25H2 build 26200.9974, Rust 1.100.0 x64 MSVC and DXC 1.8.2502.11, debug. - The WARP control on #2763 failed at the mixed-format assertion with `[128,55,0,255]`. The native RTX 4080 fixture on the new production revision passed 1/0/0 with no capability skips over five offscreen cases. With an sRGB base and transparent UNORM overlay, it read `[188,128,0,255]`. A fractional overlay read `[137,161,0,255]`. The reverse case read `[0,64,127,255]` for the fractional sample. The BGRA case also passed. - The exact portable `compositor_blends_ui_plane_over_scene_plane` test passed 1/0/0. `cargo build --workspace --locked -j 4` succeeded. `cargo test --workspace --locked -j 4 -- --test-threads=4 --show-output` reported **1,436 passed, 0 failed, 47 ignored** across 37 harnesses. The pass count includes 29 capability skips. **Regression run** Matched retail smoke runs on this head are pending. **Not tested** - Physical display output, retail smoke on this head, and other GPU vendors.
Select the output transfer from the opaque primary plane. A transparent UNORM overlay must preserve encoded scene colors. Cover RGBA and BGRA mixed formats and keep UNORM output when only an overlay is sRGB.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 14:11:16 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2811/head:github-bot/gh-2811'
git switch 'github-bot/gh-2811'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2811'
git switch 'github-bot/gh-2811'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2811'
git switch 'github-bot/gh-2811'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2811'
git switch 'main'
git merge --squash 'github-bot/gh-2811'
git switch 'main'
git merge --ff-only 'github-bot/gh-2811'
git switch 'main'
git merge 'github-bot/gh-2811'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.