Repository navigation
D3D12.X: preserve concrete sRGB plane formats in PresentX compositor SRVs - #2537
ramon-victor wants to merge 1 commit into
Conversation
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Independent AMD RDNA4 (native wave64) test report on exact head Tested
Regression run (60 s retail-title smoke, (Matched Not tested
AI use
|
|
Tested: current PR head merged onto current
Not tested: retail titles (no title data on this lane, counts only). AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting. |
luckyteagirl
left a comment
There was a problem hiding this comment.
Could the compositor re-encode its linear result for the SDR swap chain? This change correctly decodes a concrete sRGB plane through its SRV, but the compositor shader writes the linear sample directly to the UNORM RTV/PSO selected by swap_format. The swap chain still presents those integer bytes as sRGB. For an opaque midtone encoded as 188, the new test expects about 128 in the UNORM target; that is the decoded linear value, so a real SDR presentation would appear darker. The test confirms decoding but not the display-space round trip.
A two-plane case with an opaque sRGB base and a transparent overlay could compare the presented color with the existing single-plane copy path. Microsoft's color-space guidance says that linear shader output must be converted back to sRGB for integer screen presentation, for example through an sRGB RTV. Exact-head source review of e8d2258c5af20f108770ad8e0e983e9ecba8581e; I did not run a display capture or title. AI-assisted review with Codex.
…cl-dev#2480 + xcl-dev#2537) (cherry picked from commit b114829419c3fb66a8c680c8bbc7cb1acbad8c19)
|
Independent desktop NVIDIA verification of PR #2537 at head Environment
Targeted release tests & build (
|
| Command | Result |
|---|---|
cargo test --release -p xcl --lib compositor_preserves_concrete_srgb_plane_srv_format -- --nocapture (3 consecutive runs) |
1 passed; 0 failed; 0 ignored; 1324 filtered out × 3 (0.02s × 3, 0 skipped) |
cargo test --release -p xcl --lib hle::d3d12x::present:: -- --test-threads=1 (3 consecutive runs) |
10 passed; 0 failed; 0 ignored; 1315 filtered out × 3 (0.05s × 3, 0 skipped) |
cargo build --release -p xcl |
Clean build (1m 11s, exit 0, 0 new warnings) |
Paired quiet 60 s retail smoke (title: 29640639)
Exact parent & merge-base (6d12f58a229bc73889878a448c64dc3af25eeba0, cached baseline on the same machine):
xcl-smoke v1
commit: 6d12f58a229bc73889878a448c64dc3af25eeba0
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1606 (PresentX 1606)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14004 MB
PR #2537 (e8d2258c5af20f108770ad8e0e983e9ecba8581e):
xcl-smoke v1
commit: e8d2258c5af20f108770ad8e0e983e9ecba8581e
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1588 (PresentX 1589)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13973 MB
Runtime log observations (xcl.log)
9219log lines,0[ERROR]/ device-removal / panic lines.- Final draw/memory telemetry in log:
19564 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample13973 MB committed by the process; video memory 6116 MB local, 4651 MB non-local.
Limits of coverage
- Preserving concrete sRGB plane formats in
PresentXcompositor SRV descriptors was verified viacompositor_preserves_concrete_srgb_plane_srv_format(3/3) andhle::d3d12x::present::(10/10× 3,0skipped). - The 60 s retail smoke on
title: 29640639exercises livePresentXpresentation (1588frames shown,1589PresentXcalls) with zero device removals or crashes (frame-count delta vs. cached parent reflects single-run startup variance, not this PR); visual pixel-level sRGB/SDR/HDR colorimetry inspection of an sRGB plane title was not performed here.
AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
Preserves concrete
*_UNORM_SRGBresource formats when creating shader-resource views for compositedPresentXplanes inCompositor::record, resolving only*_TYPELESSformats to concrete SRV formats.Previously
Compositor::recordpassedswap_format(desc.Format).unwrap_or(desc.Format)toCreateShaderResourceView. Becauseswap_formatmapsDXGI_FORMAT_R8G8B8A8_UNORM_SRGBandDXGI_FORMAT_B8G8R8A8_UNORM_SRGBto*_UNORMfor flip-model swap-chain creation, concrete sRGB plane textures received an invalid non-sRGB SRV format (CREATESHADERRESOURCEVIEW_INVALIDFORMATin D3D12) and skipped sRGB-to-linear decoding on WARP.Part of #2456 (specifically the sRGB plane SRV format issue left open by #2480).
What is in it
crates/xcl/src/hle/d3d12x/present.rs:plane_srv_format(f)resolving only*_TYPELESSformats (R8G8B8A8_TYPELESS,B8G8R8A8_TYPELESS,R10G10B10A2_TYPELESS,R16G16B16A16_TYPELESS) to concrete SRV formats while preserving concrete formats (including*_UNORM_SRGB).plane_srv_format(desc.Format)inCompositor::recordwhen buildingD3D12_SHADER_RESOURCE_VIEW_DESC.frame_dump_tests::compositor_preserves_concrete_srgb_plane_srv_formatverifyingplane_srv_formatacross concrete sRGB, typeless, and UNORM/float formats and exercisingCompositor::recordon WARP with a concreteDXGI_FORMAT_R8G8B8A8_UNORM_SRGBplane texture.Tested
621.24, wave32), AMD Ryzen 7 5700X, 32 GiB RAM, Windows 11 Pro (26300),rustc 1.99.0(x86_64-pc-windows-msvc), DXC/DXIL1.8.2502.11(Windows SDK10.0.26100.0).cargo test -p xcl --lib compositor_preserves_concrete_srgb_plane_srv_format -- --nocapturefailed (0 passed, 1 failed:expected sRGB-decoded concrete plane sample ~[128, 55, 0, 255], got [188, 128, 0, 255]).cargo test -p xcl --lib hle::d3d12x::present -- --test-threads=1 --nocapture:10 passed, 0 failed, 0 ignored..\scripts\test.ps1, debug):1424 passed, 0 failed, 46 ignored(skipped on this adapter: wave64-only GPU tests, unsupported per-lane semantics variants,no heap windows).cargo build --release -p xcl) and clean 60 s retail smoke run (.\scripts\smoke.ps1).Regression run
Baseline (
main):PR (
e8d2258):Not tested
*_UNORM_SRGBplanes (the retail smoke title presents a single plane; multi-plane concrete sRGB compositing is covered by the WARP regression test).AI use
plane_srv_formatand its WARP regression test, ran.\scripts\test.ps1, release build, and the 60 ssmoke.ps1run, and drafted this PR description.