Skip to content

HDR detected by game but clipped to SDR #2524

Closed

Description

@Delivator

Is there an existing issue for this?

  • I have searched the existing issues

Are you using any gamescope patches or a forked version of gamescope?

  • The issue occurs on upstream gamescope without any modifications

Current Behavior

When I start a game on steam with gamescope and --hdr-enabled it launches and the game detects that HDR is available (ingame HDR settings appear) but the highlights are clipped to SDR (bright lights look flat). I took a screenshot with gamescope (super + s) and opened it with HDRView (which I know displays HDR images correctly) and the difference is very clear.

I've asked Xaver Hugl on the HDR Den discord server and he pointed me to #2091 which now fixes my issue.

Besides that I asked an LLM about this issue which pointed me towards something about a supposedly "integer overflow when forwarding mastering primaries". From that #2523 was created which also fixed my issue with HDR not displaying correctly but the PR was rightfully closed due to my lack of technical understanding of the topic.

I mentioned this to Xaver too and he said

@Delivator try the MR (#2091), it should fix it more properly
Also please do check the gamescope binary name... it shouldn't be relevant with that MR anymore, but if some distro ships it renamed or something, we should update the hack in KWin to include that until we can safely assume everyone has the commit from my MR
(the overflow fix (#2523) makes sense to submit either way, for other compositors)

Steps To Reproduce

  1. Make sure system settings HDR is enabled and monitor is set to HDR
  2. Launch a HDR capable game (tested with Ori and the Will of the Wisps and Indiana Jones and the Great Circle) using gamescope --hdr-enabled -- %command%
  3. turn on in-game HDR settings
  4. you can tell that HDR highlights are clipped to SDR as they do not light up as much as they should
  5. do a sanity check by taking a screenshot (super+s), open it with a HDR capable viewer (like HDRView) and do a side-by-side comparison

Hardware information

- Distro: CachyOS, rolling, updated today
- CPU: AMD Ryzen 7 7700X
- GPU: NVIDIA Corporation AD103 [GeForce RTX 4080]
- Driver Version: Nvidia 615.78.08

Software information

- Desktop environment: KDE 6.8.1
- Session type: wayland
- Gamescope version: gamescope version 3.17.0 (gcc 16.2.1)
- Gamescope launch command(s): `gamescope -f -W 2560 -H 1440 --hdr-enabled -- %command%`

Which gamescope backends have the issue you are reporting?

  • Wayland (default for nested gamescope)
  • DRM (default for embedded gamescope, i.e. gamescope-session)
  • SDL
  • OpenVR

Logging, screenshots, or anything else

Looked at some wayland debug logs when launching the game WAYLAND_DEBUG=1 gamescope -f -W 2560 -H 1440 --hdr-enabled -- %command% 2> ~/gs-wl.log

❯ cat ~/gs-wl.log | grep -niE "set_mastering_display_primaries|hdr"
1718:[gamescope] [Info]  xdg_backend: HDR INFO
1719:[gamescope] [Info]  xdg_backend:   cv_hdr_enabled: true
1721:[gamescope] [Info]  xdg_backend:   bExposeHDRSupport: false
1763:[gamescope] [Info]  xdg_backend: HDR INFO
1764:[gamescope] [Info]  xdg_backend:   cv_hdr_enabled: true
1766:[gamescope] [Info]  xdg_backend:   bExposeHDRSupport: true
1914:[gamescope] [Info]  xwm: HDR output enabled
7456:  server hdr output enabled:     true
7457:  hdr formats exposed to client: true
8247:[Gamescope WSI] Creating swapchain for xid: 0x240005b - oldSwapchain: (nil) - provided minImageCount: 3 - minImageCount: 3 - format: VK_FORMAT_A2B10G10R10_UNORM_PACK32 - colorspace: VK_COLOR_SPACE_HDR10_ST2084_EXT - flip: true
8913:[11:35:22.863326]  -> gamescope_swapchain#52.set_hdr_metadata(35400, 14600, 8500, 39850, 6550, 2300, 15635, 16450, 4000, 1, 4000, 500)
8914:[Gamescope WSI] VkHdrMetadataEXT: display primaries:
8944:[11:35:22.882325] gamescope_swapchain#52.set_hdr_metadata(35400, 14600, 8500, 39850, 6550, 2300, 15635, 16450, 4000, 1, 4000, 500)
8967:[11:35:22.886206] {Default Queue}  -> wp_image_description_creator_params_v1#44.set_mastering_display_primaries(20805, 34301, -1798, 23905, -40798, -39899, -30897, -14597)

Activity

  1. matte-schwartz commented on Oct 28, 2026

    @matte-schwartz
    Collaborator

    thanks, I'll take a look

  2. matte-schwartz commented on Oct 28, 2026

    @matte-schwartz
    Collaborator

    #2525 should fix it, pretty sure I did my math right...

  3. Delivator commented on Oct 29, 2026

    @Delivator
    Author

    yeah that did the trick! thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions