D3D12.X: encode sRGB compositor output for presentation #2763
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2763
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2763"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@CryingLaughing on GitHub · 2026-11-26 10:57 UTC · original
CryingLaughing:fix/present-srgb-output-encoding→main· +208 −83 · 1 files · 3 commits · openStacked on #2537. The follow-up is
0d380f427797fb91a07512d074a5f6f4e1892674, verified withb49be1836844fe0b0cdb3211dce3cb7fb4e21ac7and the exact #2537 heade8d2258c5af20f108770ad8e0e983e9ecba8581eas its integration base. Part of #2456.With concrete sRGB SRVs, the compositor reads linear values. An ordinary UNORM render target then stores those values directly, making midtones too dark on the SDR swap chain.
What is in it
Tested
Windows 11 25H2 build 26200.9974, Intel Core i5-13600K, RTX 4080 driver 621.01, Rust 1.100.0 x64 MSVC, and DXC 1.8.2502.11.
cargo test -p xcl --lib --locked -j 4 compositor_blends_ui_plane_over_scene_plane -- --show-output --test-threads=1passed 1/1 on this head using an offscreen RGBA8 target on WARP. The same fixture on the integration base failed at the intended assertion. The transparent pixel was[128, 55, 0, 255]before the fix and matched[188, 128, 0, 255]afterward.cargo build --workspace --locked -j 4passed. The four-thread workspace run stopped in the library harness ata_dispatch_with_a_pipeline_still_building_waits_at_the_submitwith 1,309 passed, 1 failed, and 27 ignored. The compositor regression passed in that run. 25 capability skips were logged before it stopped.The serial repeat,
cargo test --workspace --locked -j 4 -- --test-threads=1 --show-output, finished with 1,436 passed, 0 failed, and 47 ignored across 37 harnesses. The pass count includes 29 capability skips.The independent RX 9070 Wine comparison verified the all-sRGB result in 3/3 fresh head processes. The same hardware-selection test overlay passed 0/3 on
mainand 0/3 on the #2537 integration base. The corrected fractional-alpha pixel was[137,161,0,255].Regression run
Independent report by Anon64 on RTX 3060 12 GB, driver 581.80, Core i9-14900KF, and Windows 11 build 26200. Both release builds used the same retail title for 60 seconds. The head showed 94.1% of the paired main run’s frames and 119.8% of its peak commit, with zero crashes and device removals. A later main run peaked at 23,242 MB, showing run-to-run memory variation.
main:
PR:
Known limitation
[128, 55, 0, 255]with a transparent UNORM UI plane over an sRGB scene. The expected pixel was[188, 128, 0, 255].Not tested
e8d2258c5a' into HEAD 2329a4de28@CryingLaughing on GitHub · 2026-11-26 11:35 UTC · original
I verified a follow-up for the mixed-format case described above. Commit
96b0b189fd0a8991c8e7883823191cf54d896223is based on this exact draft head0d380f427797fb91a07512d074a5f6f4e1892674. It uses the opaque base plane to choose 8-bit SDR output encoding and keeps each input plane’s own SRV format.[128, 55, 0, 255]on the WARP negative control. The follow-up read back[188, 128, 0, 255]on the RTX 4080. Native checks also covered fractional-alpha UI, BGRA, and the reverse mix with a UNORM base and an sRGB UI. All five offscreen checks ran in one focused test, with 1 passed, 0 failed, 0 ignored, 0 capability skips.cargo build --workspace --locked -j 4andcargo test --workspace --locked -j 4 -- --test-threads=4 --show-outputpassed with 1,436 passed, 0 failed, 47 ignored across 37 harnesses, including 29 capability skips in the pass count.RTX 4080 driver 621.01, i5-13600K, Windows 11 25H2 build 26200.9974, Rust 1.100.0 x64 MSVC and DXC 1.8.2502.11. The native test was
hle::d3d12x::present::frame_dump_tests::compositor_blends_ui_plane_over_scene_planewith an adapter-selection and readback-logging overlay. Physical display output and retail smoke remain untested.@Anon64 on GitHub · 2026-11-26 12:10 UTC · original · edited 2026-11-26 12:16 UTC
Regression run of
0d380f4on a newer retail title: no device removal, no crash, but peak commit close to the 125 % limit in both runs.Setup: RTX 3060 12 GB (NVIDIA 581.80), i9-14900KF, Windows 11 26200, release builds of main
b49be18(this PR's base) and of this PR's exact head,scripts/smoke.ps1 -Game <title>for 60 s withXCL_NETWORK=0and A pressed every 4 s from 20 s.main:
this PR, second run (the first had 1481 frames and peak commit 23754 MB):
94 % of main's frames, 120 % of its peak commit (124 % in the first run). Peak commit varies on this title: on the same machine today, other builds whose runtime matches main or an older main peaked at 17.4–21.1 GB, so this may be noise, but both runs of this head are above all of those.
Update: main
b49be18run again later in the day on the same machine peaked at 23242 MB (1476 frames), so the commit on this title drifts up over the day here. Against that run this PR is at 99–102 % of main's peak commit and 100–101 % of its frames: no sign the PR raises commit.Not tested: the suite on this head; the colours on screen; AMD.
AI use: Claude Code (Claude Opus 5.5) ran these runs on this machine and wrote this report.
@SzczepanGrela on GitHub · 2026-11-26 12:26 UTC · original
Physical RX 9070 offscreen readback under Wine confirms the all-sRGB blend case, using a test-only hardware-adapter overlay.
Tested
0d380f427797fb91a07512d074a5f6f4e1892674, mainb49be1836844fe0b0cdb3211dce3cb7fb4e21ac7, and the pinned #2537 integration basee8d2258c5af20f108770ad8e0e983e9ecba8581e.8293130ebe370b1+(local asserts-disabled build), DXC/DXIL 1.9.2602.17, Rust 1.97.1, releasex86_64-pc-windows-gnu.compositor_blends_ui_plane_over_scene_planefixture to both controls. In all three, replaced its forced WARP adapter with explicit RX 9070 selection and logged the readback pixels. Production code was unchanged in each tree. The head's separate concrete-sRGB view test also selected hardware.--exact hle::d3d12x::present::frame_dump_tests::compositor_blends_ui_plane_over_scene_plane --nocapture --test-threads=1. Three fresh processes per revision, no skip markers or ignored tests.Both input planes are RGBA8 sRGB in this case. The pixels below were identical in all three repetitions:
[188,128,0,255][94,201,0,255][128,55,0,255][64,91,0,255][188,128,0,255][137,161,0,255]The UNORM case produced its expected transparent, opaque and fractional-alpha pixels on every revision. The opaque sRGB UI pixel was
[255,0,0,255]throughout. On the head,compositor_preserves_concrete_srgb_plane_srv_formatalso passed 1/0/0 with the hardware-adapter overlay. All ten raw test summaries, pixel logs and source hashes were checked after testing.Not tested
The unmodified WARP fixtures, mixed sRGB/UNORM inputs, BGRA/HDR, physical display output, retail smoke, full workspace suite, or performance. This is offscreen synthetic coverage with a documented test overlay.
AI use
OpenAI Codex (GPT-6; exact serving variant not exposed) reviewed the changes, prepared the test-only overlay, ran and checked the comparisons, and drafted this report. Publication authorized by the account owner.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.