display: HDR10 with the interface over the HDR scene #386

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

@⁠Citizen07 on GitHub · 2026-12-03 23:24 UTC · original
Citizen07:feat/hdr-composed-output → main · +815 −25 · 7 files · 4 commits · open

Cause. With VICTORY_HDR=1 and a separate interface plane (VICTORY_UI_PLANE), the title presents two planes: its interface first, in sRGB (color space 0, R8G8B8A8, premultiplied alpha), and the scene second, in HDR10 (color space 12, PQ BT.2020, R10G10B10A2, opaque). The composer drew the second plane over the first into an RGBA8 swap chain, so the opaque scene covered the interface and its PQ values were shown as SDR. On the menus, where the scene plane is near-black, the whole screen was black. The log said VICTORY_HDR=1, but the title presents in an SDR format: presented as SDR format=28.

The color spaces were read from the retail PresentX plane parameters (RetailPlane::color_space, which nothing used yet), and both planes were saved from a few frames to check what they hold. On a menu, plane 0 is the whole interface (opaque) and plane 1 a uniform PQ black. In play, plane 0 has alpha on 3–6% of the screen and plane 1 is the scene.

Change.

  • queue::spaces(): the first two planes' color spaces from each present, logged when they change.
  • With HDR on and a plane in HDR10, that plane is the scene and the other goes over it, whichever order the title lists them in (compose::hdr_order). Both are taken to BT.2020 nits, the sRGB plane decoded un-premultiplied with its white at VICTORY_HDR_UI_NITS (203 by default, BT.2408 reference white). They are blended there, PQ encoded and presented through an R10G10B10A2 swap chain with the HDR10 color space (Composer::record_hdr).
  • When the swap chain cannot present HDR10 (no HDR surface; on native Windows, also when the window's display is not in HDR), the scene is tone mapped to sRGB and the interface goes over it as in plain SDR, so the picture is right in SDR too.
  • Without HDR, or with no HDR10 plane, nothing changes.
  • VICTORY_HDR_UI_NITS is in run.conf.default (menu label "HDR interface brightness") and docs/SETTINGS.md. The VICTORY_HDR text no longer points to xmem.sh hdr, which does not exist, and says how HDR is shown.
  • VICTORY_PLANE_SHOT=<frame>[,<frame>...] with VICTORY_PLANE_SHOT_DIR saves those frames' presented planes as PNG and logs each channel's range (docs/DIAGNOSTICS.md). It is how the planes above were read.

Tested. RX 9070 XT, RADV (Mesa 26.3), KDE Plasma 6.8.3 (Wayland), gamescope 3.17.0, an HDR TV over HDMI.

  • New tests: compose::order_tests (plane order by color space) and compose::tests::blends_an_srgb_interface_over_an_hdr10_scene_in_nits (diagnostics build, read back from the card). The HDR10 output is within 1/1023 of the expected PQ; the sRGB fallback is within 4/1023, because the card's pow decodes PQ about 1% off at 100 nits.
  • victory-core tests pass, including the menu's.
  • Through gamescope -f --hdr-enabled -- ./run.sh play VICTORY_HDR=1: HDR: the swap chain presents in HDR, menus and play in HDR, and the interface over the scene.
  • The victory-gpu suite has the same failures with and without this change: descriptor::tests::views_die_with_their_resource (the process ends), indirect::tests::host_list_* (2) and watch:: tests (4, run alone).

Limits.

  • gamescope 3.17's Wayland backend offers HDR to clients only when the compositor's maximum luminance is above its reference luminance. On KDE that means the display's SDR brightness must be below its peak brightness; at equal values bExposeHDRSupport is false and this falls back to tone-mapped SDR.
  • Frame generation (VICTORY_FIDELITYFX_FRAMEGEN) needs an RGBA8 swap chain and presents without it in HDR, as before.
  • Only the two-plane case was seen. A single HDR10 plane already went to an R10G10B10A2 swap chain and is unchanged. A single sRGB plane with HDR on stays SDR.

🤖 Generated with Claude Code

**@⁠Citizen07** on GitHub · 2026-12-03 23:24 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/386) `Citizen07:feat/hdr-composed-output` → `main` · +815 −25 · 7 files · 4 commits · open **Cause.** With `VICTORY_HDR=1` and a separate interface plane (`VICTORY_UI_PLANE`), the title presents two planes: its interface first, in sRGB (color space 0, R8G8B8A8, premultiplied alpha), and the scene second, in HDR10 (color space 12, PQ BT.2020, R10G10B10A2, opaque). The composer drew the second plane over the first into an RGBA8 swap chain, so the opaque scene covered the interface and its PQ values were shown as SDR. On the menus, where the scene plane is near-black, the whole screen was black. The log said `VICTORY_HDR=1, but the title presents in an SDR format: presented as SDR format=28`. The color spaces were read from the retail PresentX plane parameters (`RetailPlane::color_space`, which nothing used yet), and both planes were saved from a few frames to check what they hold. On a menu, plane 0 is the whole interface (opaque) and plane 1 a uniform PQ black. In play, plane 0 has alpha on 3–6% of the screen and plane 1 is the scene. **Change.** - `queue::spaces()`: the first two planes' color spaces from each present, logged when they change. - With HDR on and a plane in HDR10, that plane is the scene and the other goes over it, whichever order the title lists them in (`compose::hdr_order`). Both are taken to BT.2020 nits, the sRGB plane decoded un-premultiplied with its white at `VICTORY_HDR_UI_NITS` (203 by default, BT.2408 reference white). They are blended there, PQ encoded and presented through an R10G10B10A2 swap chain with the HDR10 color space (`Composer::record_hdr`). - When the swap chain cannot present HDR10 (no HDR surface; on native Windows, also when the window's display is not in HDR), the scene is tone mapped to sRGB and the interface goes over it as in plain SDR, so the picture is right in SDR too. - Without HDR, or with no HDR10 plane, nothing changes. - `VICTORY_HDR_UI_NITS` is in `run.conf.default` (menu label "HDR interface brightness") and `docs/SETTINGS.md`. The `VICTORY_HDR` text no longer points to `xmem.sh hdr`, which does not exist, and says how HDR is shown. - `VICTORY_PLANE_SHOT=<frame>[,<frame>...]` with `VICTORY_PLANE_SHOT_DIR` saves those frames' presented planes as PNG and logs each channel's range (`docs/DIAGNOSTICS.md`). It is how the planes above were read. **Tested.** RX 9070 XT, RADV (Mesa 26.3), KDE Plasma 6.8.3 (Wayland), gamescope 3.17.0, an HDR TV over HDMI. - New tests: `compose::order_tests` (plane order by color space) and `compose::tests::blends_an_srgb_interface_over_an_hdr10_scene_in_nits` (diagnostics build, read back from the card). The HDR10 output is within 1/1023 of the expected PQ; the sRGB fallback is within 4/1023, because the card's `pow` decodes PQ about 1% off at 100 nits. - `victory-core` tests pass, including the menu's. - Through `gamescope -f --hdr-enabled -- ./run.sh play VICTORY_HDR=1`: `HDR: the swap chain presents in HDR`, menus and play in HDR, and the interface over the scene. - The `victory-gpu` suite has the same failures with and without this change: `descriptor::tests::views_die_with_their_resource` (the process ends), `indirect::tests::host_list_*` (2) and `watch::` tests (4, run alone). **Limits.** - gamescope 3.17's Wayland backend offers HDR to clients only when the compositor's maximum luminance is above its reference luminance. On KDE that means the display's SDR brightness must be below its peak brightness; at equal values `bExposeHDRSupport` is false and this falls back to tone-mapped SDR. - Frame generation (`VICTORY_FIDELITYFX_FRAMEGEN`) needs an RGBA8 swap chain and presents without it in HDR, as before. - Only the two-plane case was seen. A single HDR10 plane already went to an R10G10B10A2 swap chain and is unchanged. A single sRGB plane with HDR on stays SDR. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
With VICTORY_HDR=1, the title presents two planes: its
interface first, in sRGB (color space 0, 8-bit, premultiplied alpha), and
the scene second, in HDR10 (color space 12, PQ BT.2020, 10-bit, opaque).
The composer drew the second over the first into an RGBA8 swap chain, so
the opaque scene covered the interface and the PQ values were shown as
SDR: a black screen on the menus.

The planes' color spaces are now read from the retail PresentX plane
parameters (queue::spaces). With HDR on and a plane in HDR10, that plane
is the scene and the other goes over it, whichever order the title lists
them in; both are taken to BT.2020 nits (an sRGB plane's white at
VICTORY_HDR_UI_NITS, 203 by default), blended there and PQ encoded into
an R10G10B10A2 swap chain. When the swap chain cannot present HDR10, the
blend is tone mapped to sRGB instead.

HDR is shown only through gamescope --hdr-enabled, which offers it only
when the desktop's SDR brightness is below the display's peak (KWin's
reference luminance below its maximum). Frame generation needs an RGBA8
swap chain and is off with it.

VICTORY_PLANE_SHOT=<frame>[,<frame>...] (diagnostics) saves the presented
planes and logs their channel ranges.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-03 23:25:25 +00:00
Author
Owner

@⁠Kal0s-design on GitHub · 2026-12-04 06:45 UTC · original

Tried this natively on Windows 11 (MSVC build) with one NVIDIA desktop card and with WARP. No HDR display was used, so this covers the shader math and the swap chain checks only, not how it looks on a real HDR screen.

blends_an_srgb_interface_over_an_hdr10_scene_in_nits and order_tests pass on both adapters, with identical HDR10 readback (0.5083, 0.5503, 0.5806). I also added a few throwaway cases locally (not pushed). A PQ scene at 0, 100, 1000 and 10000 nits with nothing over it comes back bit exact, and opaque sRGB red, green, blue and white over a black scene land within 0.6 of a 10-bit step of PQ(matrix column x 203), so the constants and the matrix orientation look right. The rest of the victory-gpu suite shows only the failures it already has natively on this machine, and clippy has nothing new in the changed code.

A few things worth a look

  1. On native Windows the tone mapped fallback probably never kicks in. This desktop output is SDR (IDXGIOutput6::GetDesc1 reports ColorSpace 0), yet a flip-model R10G10B10A2 swap chain still reports PRESENT support for G2084_NONE_P2020 on both adapters. So set_hdr_space gets past its support check and out_sdr would stay false, handing PQ to an SDR desktop and leaving the conversion to Windows instead of your shoulder (I could not look at the result). Adding a check of the containing output's GetDesc1().ColorSpace on Windows, next to the existing one, would cover it. The choice is also only made at swap chain creation or resize, so turning Windows HDR on or off or moving the window to another display keeps the old one.
  2. An overlay texel with alpha 0 and some color (additive glow) is dropped in HDR because of the c.a > 0 ? ... : 0 branch in nits_of, while the SDR ps adds it. Locally a (0.25, 0.25, 0.25, 0) texel over a 100 nit scene gives exactly the scene. Texels with rgb > a get clamped by saturate(c.rgb / c.a) the same way. Your plane shots probably show whether the title's HUD does this.
  3. In the SDR fallback the shoulder starts at 0.8 of the interface white, so a fully white menu comes out at about 0.967 instead of 1.0 (your test expects that value). Menus will look a little dimmer than plain SDR. Mapping the interface white to 1.0, or tone mapping only the scene before the blend, would keep the UI as it was.
  4. Minor. compose::view passes _SRGB formats through, and nits_of then decodes sRGB a second time. An _SRGB plane holding linear 0.5 came out at about 43 nits instead of 101.5. Only matters if the title ever hands the UI plane as _SRGB.

AI-assisted: yes

**@⁠Kal0s-design** on GitHub · 2026-12-04 06:45 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/386#issuecomment-7403832664) Tried this natively on Windows 11 (MSVC build) with one NVIDIA desktop card and with WARP. No HDR display was used, so this covers the shader math and the swap chain checks only, not how it looks on a real HDR screen. `blends_an_srgb_interface_over_an_hdr10_scene_in_nits` and `order_tests` pass on both adapters, with identical HDR10 readback (0.5083, 0.5503, 0.5806). I also added a few throwaway cases locally (not pushed). A PQ scene at 0, 100, 1000 and 10000 nits with nothing over it comes back bit exact, and opaque sRGB red, green, blue and white over a black scene land within 0.6 of a 10-bit step of PQ(matrix column x 203), so the constants and the matrix orientation look right. The rest of the victory-gpu suite shows only the failures it already has natively on this machine, and clippy has nothing new in the changed code. A few things worth a look 1. On native Windows the tone mapped fallback probably never kicks in. This desktop output is SDR (`IDXGIOutput6::GetDesc1` reports ColorSpace 0), yet a flip-model R10G10B10A2 swap chain still reports PRESENT support for `G2084_NONE_P2020` on both adapters. So `set_hdr_space` gets past its support check and `out_sdr` would stay false, handing PQ to an SDR desktop and leaving the conversion to Windows instead of your shoulder (I could not look at the result). Adding a check of the containing output's `GetDesc1().ColorSpace` on Windows, next to the existing one, would cover it. The choice is also only made at swap chain creation or resize, so turning Windows HDR on or off or moving the window to another display keeps the old one. 2. An overlay texel with alpha 0 and some color (additive glow) is dropped in HDR because of the `c.a > 0 ? ... : 0` branch in `nits_of`, while the SDR `ps` adds it. Locally a (0.25, 0.25, 0.25, 0) texel over a 100 nit scene gives exactly the scene. Texels with rgb > a get clamped by `saturate(c.rgb / c.a)` the same way. Your plane shots probably show whether the title's HUD does this. 3. In the SDR fallback the shoulder starts at 0.8 of the interface white, so a fully white menu comes out at about 0.967 instead of 1.0 (your test expects that value). Menus will look a little dimmer than plain SDR. Mapping the interface white to 1.0, or tone mapping only the scene before the blend, would keep the UI as it was. 4. Minor. `compose::view` passes `_SRGB` formats through, and `nits_of` then decodes sRGB a second time. An `_SRGB` plane holding linear 0.5 came out at about 43 nits instead of 101.5. Only matters if the title ever hands the UI plane as `_SRGB`. AI-assisted: yes
- On native Windows, HDR also needs the window's display to be in HDR
  (its output's colour space HDR10): a flip-model swap chain can report
  HDR10 support on an SDR desktop. Otherwise the swap chain is set back
  to SDR and the planes are tone mapped. Skipped under Wine, whose dxgi
  does not report the display's colour space.
- An sRGB interface texel's colour above its alpha (additive glow, as
  with alpha 0) is decoded on its own and added, no longer dropped.
- The SDR fallback tone maps only the scene and puts the interface over
  it as the SDR path does, so a white interface stays at 1.0.
- An interface plane read through an _SRGB view is taken as linear, not
  decoded a second time.

The HDR readback test also covers a glow texel and an _SRGB interface.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Owner

@⁠Citizen07 on GitHub · 2026-12-04 08:31 UTC · original

Thanks for running it natively. All four are in 1af6fd9:

  1. On native Windows, HDR now also needs the containing output's GetDesc1().ColorSpace to be G2084; otherwise the swap chain is set back to G22 and the blend is tone mapped. Under Wine that check is skipped (the dxgi there doesn't report the desktop's colour space). The choice is still only made at creation or resize, so turning Windows HDR on or off or moving the window to another display isn't followed yet. Linux is the target, so I left that out for now.
  2. The part of an sRGB texel above its alpha is now decoded on its own and added, so alpha-0 glow survives in HDR.
  3. The SDR fallback now tone maps only the scene and puts the interface over it as the SDR path does, so white UI is 1.0.
  4. _SRGB interface planes are now taken as already linear.

The readback test now also covers a glow texel and an _SRGB interface.

**@⁠Citizen07** on GitHub · 2026-12-04 08:31 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/386#issuecomment-7406053882) Thanks for running it natively. All four are in 1af6fd9: 1. On native Windows, HDR now also needs the containing output's `GetDesc1().ColorSpace` to be G2084; otherwise the swap chain is set back to G22 and the blend is tone mapped. Under Wine that check is skipped (the dxgi there doesn't report the desktop's colour space). The choice is still only made at creation or resize, so turning Windows HDR on or off or moving the window to another display isn't followed yet. Linux is the target, so I left that out for now. 2. The part of an sRGB texel above its alpha is now decoded on its own and added, so alpha-0 glow survives in HDR. 3. The SDR fallback now tone maps only the scene and puts the interface over it as the SDR path does, so white UI is 1.0. 4. `_SRGB` interface planes are now taken as already linear. The readback test now also covers a glow texel and an `_SRGB` interface.
Author
Owner

@⁠Kal0s-design on GitHub · 2026-12-04 09:36 UTC · original

Checked 1af6fd9 natively on Windows 11 again, one NVIDIA desktop card and WARP, debug layer on. All four look fixed to me.

  1. Output colour space. set_hdr_space now asks display_in_hdr after the support check and goes back to G22 when it says no (host.rs:7735-7744). The desktop here is not in HDR mode. With a throwaway local test (not pushed) that makes a small window and a flip R10G10B10A2 swap chain on the real adapter and calls the same functions with VICTORY_HDR=1, the NVIDIA card gives CheckColorSpaceSupport = PRESENT as before, but the output reports colour space 0, display_in_hdr is Some(false) and hdr_shown() stays false after set_hdr_space, so out_sdr would be true (host.rs:8618). The Wine check (host.rs:7671-7681) looks up wine_get_version in ntdll, which Windows' ntdll doesn't export, so it came back false here and I don't see how it could misfire natively. The other way round, a Wine build set to hide its exports would look native, but that's for the Linux side.

One small thing. On WARP GetContainingOutput fails with DXGI_ERROR_UNSUPPORTED, so display_in_hdr returns None and HDR stays on (hdr_shown() true). WARP doesn't matter for playing, but any native setup where the output can't be read the same way ends up on the old path. If you care, treating None like Some(false) on native Windows, or finding the output from MonitorFromWindow across the factory's adapters, would cover it. I haven't tried that on a laptop with two GPUs.

  1. Glow. nits_of now adds the part above alpha, decoded on its own (compose.rs:75-82). The (0.25, 0.25, 0.25, 0) texel over the 100 nit scene reads 530/1023 on both adapters. pq(100 + 0.0509 x 203 = 110.3 nits) is 529.9, and the scene alone is 520.

  2. SDR fallback. The scene is tone mapped alone and the UI goes over it (compose.rs:111-119). White UI reads 1023, half white 885 (expected 0.5 + 0.5 x srgb(100/203) = 885.1) and the glow 1005 (expected 1003.0, with 0.25 kept as 64/255).

  3. _SRGB. decodes_srgb covers R8G8B8A8 and B8G8R8A8 _SRGB (compose.rs:161-166, passed in at compose.rs:337), which are the _SRGB colour formats view passes through (compose.rs:482), and nits_of skips the decode for them. The _SRGB glow in HDR reads 563 (expected pq(100 + 0.25 x 203) = 562.5) and half white 564/563 against 563.0. In the SDR fallback the _SRGB row is 748, 1023, 1023, 1023, as expected after re-encoding.

Test results. compose filter is 3/3 on both adapters, readbacks above are the same on both apart from 1 step. The debug layer had no messages after them. The whole victory-gpu lib suite is 388 passed, 6 failed on each adapter. All six are in indirect, pipeline::host, watch and descriptor::host, nothing this PR touches, and the ones I reran on the base commit fail there too or pass on rerun (watch).

I also reverted each shader fix alone locally to see whether the new test catches it. Putting back saturate(c.rgb / a) without the added part fails at the glow texel (520 against 530). Tone mapping the whole blend again fails at half white in the SDR fallback (white UI goes back to 0.967). Ignoring over_linear fails at the _SRGB glow in HDR. So the test covers all three.

AI-assisted: yes

**@⁠Kal0s-design** on GitHub · 2026-12-04 09:36 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/386#issuecomment-7407553510) Checked 1af6fd9 natively on Windows 11 again, one NVIDIA desktop card and WARP, debug layer on. All four look fixed to me. 1. Output colour space. `set_hdr_space` now asks `display_in_hdr` after the support check and goes back to G22 when it says no (host.rs:7735-7744). The desktop here is not in HDR mode. With a throwaway local test (not pushed) that makes a small window and a flip R10G10B10A2 swap chain on the real adapter and calls the same functions with VICTORY_HDR=1, the NVIDIA card gives `CheckColorSpaceSupport` = PRESENT as before, but the output reports colour space 0, `display_in_hdr` is `Some(false)` and `hdr_shown()` stays false after `set_hdr_space`, so `out_sdr` would be true (host.rs:8618). The Wine check (host.rs:7671-7681) looks up `wine_get_version` in ntdll, which Windows' ntdll doesn't export, so it came back false here and I don't see how it could misfire natively. The other way round, a Wine build set to hide its exports would look native, but that's for the Linux side. One small thing. On WARP `GetContainingOutput` fails with DXGI_ERROR_UNSUPPORTED, so `display_in_hdr` returns `None` and HDR stays on (`hdr_shown()` true). WARP doesn't matter for playing, but any native setup where the output can't be read the same way ends up on the old path. If you care, treating `None` like `Some(false)` on native Windows, or finding the output from `MonitorFromWindow` across the factory's adapters, would cover it. I haven't tried that on a laptop with two GPUs. 2. Glow. `nits_of` now adds the part above alpha, decoded on its own (compose.rs:75-82). The (0.25, 0.25, 0.25, 0) texel over the 100 nit scene reads 530/1023 on both adapters. pq(100 + 0.0509 x 203 = 110.3 nits) is 529.9, and the scene alone is 520. 3. SDR fallback. The scene is tone mapped alone and the UI goes over it (compose.rs:111-119). White UI reads 1023, half white 885 (expected 0.5 + 0.5 x srgb(100/203) = 885.1) and the glow 1005 (expected 1003.0, with 0.25 kept as 64/255). 4. `_SRGB`. `decodes_srgb` covers R8G8B8A8 and B8G8R8A8 _SRGB (compose.rs:161-166, passed in at compose.rs:337), which are the _SRGB colour formats `view` passes through (compose.rs:482), and `nits_of` skips the decode for them. The _SRGB glow in HDR reads 563 (expected pq(100 + 0.25 x 203) = 562.5) and half white 564/563 against 563.0. In the SDR fallback the _SRGB row is 748, 1023, 1023, 1023, as expected after re-encoding. Test results. `compose` filter is 3/3 on both adapters, readbacks above are the same on both apart from 1 step. The debug layer had no messages after them. The whole victory-gpu lib suite is 388 passed, 6 failed on each adapter. All six are in indirect, pipeline::host, watch and descriptor::host, nothing this PR touches, and the ones I reran on the base commit fail there too or pass on rerun (watch). I also reverted each shader fix alone locally to see whether the new test catches it. Putting back `saturate(c.rgb / a)` without the added part fails at the glow texel (520 against 530). Tone mapping the whole blend again fails at half white in the SDR fallback (white UI goes back to 0.967). Ignoring `over_linear` fails at the _SRGB glow in HDR. So the test covers all three. AI-assisted: yes
Author
Owner

@⁠Luxuride on GitHub · 2026-12-04 11:28 UTC · original

I could not find a defect in the paths I can check statically: the composer is created with the already-computed R10G10B10A2 format at both sites and remade when it changes (host.rs:8379-8385, :8448, :8469-8478), the five root constants match num32BitConstants=5 and the cbuffer order (compose.rs:22-33 vs :332-338), and over_linear is taken from planes[1] after the swap.

One contradiction to settle: docs/SETTINGS.md:21 says of VICTORY_HDR "Frame generation is off with it", and nothing enforces that — hdr() is read only in the swap-chain colour space and the plane blend (host.rs:7651, :7713, :8311), framegen.rs never mentions HDR. What the code does is skip the proxy's interface plane (host.rs:8560-8562). Either add the guard or drop the sentence; as written the table promises behaviour the code does not have.

Smaller: sdr_white_nits() silently becomes 203 outside 10..=1000 (compose.rs:171-177) while the menu offers 100..400 — a typo reads as "6x too dim" with no log line; and hdr_order (compose.rs:152-158) also fires its arms when both planes are PQ, which the doc does not cover.

plane_shot reads back a buffer inside the presenter borrow (bench.rs:242-300) — diagnostic-only, but worth a comment so nobody copies it.

**@⁠Luxuride** on GitHub · 2026-12-04 11:28 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/386#issuecomment-7410144674) I could not find a defect in the paths I can check statically: the composer is created with the already-computed `R10G10B10A2` format at both sites and remade when it changes (`host.rs:8379-8385`, `:8448`, `:8469-8478`), the five root constants match `num32BitConstants=5` and the cbuffer order (`compose.rs:22-33` vs `:332-338`), and `over_linear` is taken from `planes[1]` after the swap. One contradiction to settle: `docs/SETTINGS.md:21` says of `VICTORY_HDR` "Frame generation is off with it", and nothing enforces that — `hdr()` is read only in the swap-chain colour space and the plane blend (`host.rs:7651`, `:7713`, `:8311`), `framegen.rs` never mentions HDR. What the code does is skip the proxy's *interface* plane (`host.rs:8560-8562`). Either add the guard or drop the sentence; as written the table promises behaviour the code does not have. Smaller: `sdr_white_nits()` silently becomes 203 outside 10..=1000 (`compose.rs:171-177`) while the menu offers 100..400 — a typo reads as "6x too dim" with no log line; and `hdr_order` (`compose.rs:152-158`) also fires its arms when both planes are PQ, which the doc does not cover. `plane_shot` reads back a buffer inside the presenter borrow (`bench.rs:242-300`) — diagnostic-only, but worth a comment so nobody copies it.
- Native Windows: an output whose colour space cannot be read (WARP has
  none) counts as SDR, so the blend is tone mapped rather than PQ handed
  to a display that may not show it.
- VICTORY_HDR_UI_NITS and VICTORY_HDR_NITS warn when their value is
  rejected instead of falling back silently; the UI white is read once.
- SETTINGS.md: frame generation is not turned off with HDR; the interface
  is interpolated with the scene, as both are blended before it.
- hdr_order's doc covers two HDR10 planes; plane_shot says it stalls the
  present and is diagnostic only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Owner

@⁠Citizen07 on GitHub · 2026-12-04 12:00 UTC · original

Thanks both. In 5fb2dd4:

@⁠Kal0s-design: thanks for checking again. On native Windows an output that can't be read (WARP, or anything where GetContainingOutput / GetDesc1 fails) now counts as SDR, with a warning, so it goes to the tone mapped path instead of handing PQ to an unknown display. Under Wine nothing changes. I can't run that branch here (it's skipped under Wine), so a native run on WARP would confirm hdr_shown() is now false there.

@⁠Luxuride:

  • Frame generation: the sentence was wrong. It isn't turned off with HDR. Both planes are blended in nits before the proxy, which then gets the whole frame, so the interface is interpolated with the scene. SETTINGS.md now says that instead.
  • VICTORY_HDR_UI_NITS outside 10..=1000 (or not a number) now logs a warning once and uses 203. It's read once rather than every frame. VICTORY_HDR_NITS warns the same way when it falls back to 1000.
  • hdr_order's doc now covers both planes being HDR10: the first is the scene, the second goes over it, each decoded from PQ.
  • plane_shot now has a comment saying it waits for the card inside the presenter borrow and stalls that present, so it's for diagnostics only.

The compose tests (order_tests plus the diagnostics readback tests) pass, 3/3, under Wine on the real GPU.

**@⁠Citizen07** on GitHub · 2026-12-04 12:00 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/386#issuecomment-7410843298) Thanks both. In 5fb2dd4: @⁠Kal0s-design: thanks for checking again. On native Windows an output that can't be read (WARP, or anything where `GetContainingOutput` / `GetDesc1` fails) now counts as SDR, with a warning, so it goes to the tone mapped path instead of handing PQ to an unknown display. Under Wine nothing changes. I can't run that branch here (it's skipped under Wine), so a native run on WARP would confirm `hdr_shown()` is now false there. @⁠Luxuride: - Frame generation: the sentence was wrong. It isn't turned off with HDR. Both planes are blended in nits before the proxy, which then gets the whole frame, so the interface is interpolated with the scene. `SETTINGS.md` now says that instead. - `VICTORY_HDR_UI_NITS` outside 10..=1000 (or not a number) now logs a warning once and uses 203. It's read once rather than every frame. `VICTORY_HDR_NITS` warns the same way when it falls back to 1000. - `hdr_order`'s doc now covers both planes being HDR10: the first is the scene, the second goes over it, each decoded from PQ. - `plane_shot` now has a comment saying it waits for the card inside the presenter borrow and stalls that present, so it's for diagnostics only. The compose tests (`order_tests` plus the diagnostics readback tests) pass, 3/3, under Wine on the real GPU.
Author
Owner

@⁠Kal0s-design on GitHub · 2026-12-04 12:05 UTC · original

Checked 5fb2dd4 natively on Windows 11, one NVIDIA desktop card and WARP, debug layer on, with the same throwaway local test as before and VICTORY_HDR=1.

On WARP GetContainingOutput still fails with DXGI_ERROR_UNSUPPORTED, but now the warning at host.rs:7714 is logged, display_in_hdr gives Some(false) and hdr_shown() is false after set_hdr_space. The NVIDIA card is unchanged, false as before since the desktop here is not in HDR mode, and the Wine early return (host.rs:7701) isn't touched. Small cosmetic thing, on WARP it's followed by the "Windows HDR is off for it" warning (host.rs:7749-7752), a bit odd with no display at all.

VICTORY_HDR_UI_NITS out of range or not a number warns once and gives 203, VICTORY_HDR_NITS warns and gives 1000, valid values are kept (compose.rs:175-185, host.rs:7642-7651). compose with --features diagnostics is 3/3 on both adapters and the debug layer had no messages.

AI-assisted: yes

**@⁠Kal0s-design** on GitHub · 2026-12-04 12:05 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/386#issuecomment-7410959915) Checked 5fb2dd4 natively on Windows 11, one NVIDIA desktop card and WARP, debug layer on, with the same throwaway local test as before and VICTORY_HDR=1. On WARP `GetContainingOutput` still fails with DXGI_ERROR_UNSUPPORTED, but now the warning at host.rs:7714 is logged, `display_in_hdr` gives `Some(false)` and `hdr_shown()` is false after `set_hdr_space`. The NVIDIA card is unchanged, false as before since the desktop here is not in HDR mode, and the Wine early return (host.rs:7701) isn't touched. Small cosmetic thing, on WARP it's followed by the "Windows HDR is off for it" warning (host.rs:7749-7752), a bit odd with no display at all. `VICTORY_HDR_UI_NITS` out of range or not a number warns once and gives 203, `VICTORY_HDR_NITS` warns and gives 1000, valid values are kept (compose.rs:175-185, host.rs:7642-7651). `compose` with `--features diagnostics` is 3/3 on both adapters and the debug layer had no messages. AI-assisted: yes
github-bot force-pushed github-bot/gh-386 from 5fb2dd4391 to 329c5ce7af 2026-12-04 12:17:20 +00:00 Compare
Author
Owner

@⁠Citizen07 on GitHub · 2026-12-04 12:15 UTC · original

@⁠Kal0s-design thanks for checking again on both adapters. The double warning is fixed in 329c5ce: display_in_hdr now logs the one reason the display counts as SDR (not set to HDR, or its colour space can't be read), and set_hdr_space no longer adds "Windows HDR is off for it" after it.

I've also rebased the branch onto current main. The only conflict was hdr_nits against #427, which now keeps that PR's is_finite() rule as well as the warning. The compose tests are 3/3 under Wine. The rest of the victory-gpu lib suite fails the same 6 tests as main (indirect, watch), and descriptor::tests::views_die_with_their_resource crashes the test process on main too.

**@⁠Citizen07** on GitHub · 2026-12-04 12:15 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/386#issuecomment-7411186929) @⁠Kal0s-design thanks for checking again on both adapters. The double warning is fixed in 329c5ce: `display_in_hdr` now logs the one reason the display counts as SDR (not set to HDR, or its colour space can't be read), and `set_hdr_space` no longer adds "Windows HDR is off for it" after it. I've also rebased the branch onto current `main`. The only conflict was `hdr_nits` against #427, which now keeps that PR's `is_finite()` rule as well as the warning. The compose tests are 3/3 under Wine. The rest of the victory-gpu lib suite fails the same 6 tests as `main` (`indirect`, `watch`), and `descriptor::tests::views_die_with_their_resource` crashes the test process on `main` too.
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/bench.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

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