Skip to content

HDR PQ presentation on Linux and Windows through the Vulkan view #190

Open

Description

@mcoliver

Summary

Add HDR PQ (and later HLG) presentation on Linux and Windows through the existing Vulkan view, the way macOS does it through the Metal view: OCIO encodes the output for the display, and the swapchain is tagged with that color space.

This is the short path. The long-term path, rendering natively with QRhi (#70), would also give HDR, but it's a multi-phase port that hasn't started.

Where things are

  • macOS has SDR, EDR, HDR PQ and HDR HLG presentation (MetalPresentationFormat.mm). The mode comes from the Display/macosPresentation preference or UTV_MACOS_PRESENTATION. ocio_source_setup.py (read_presentation_mode(), PRESENTATION_DISPLAYS) picks the matching OCIO display, Rec.2100-PQ - Display for PQ, so the frame UTV hands to the Metal layer is already PQ-encoded.
  • Linux and Windows only have SDR. Display bits of 10/10/10/2 select the Vulkan view (RvDocument.cpp, want10bit), which presents 10-bit sRGB. IPCore still renders with OpenGL, and the Vulkan view only presents: the frame comes across through GL/Vulkan interop, or through the CPU fallback.
  • VulkanWindow.cpp deliberately requires VK_COLOR_SPACE_SRGB_NONLINEAR_KHR. With HDR on, NVIDIA lists a 10-bit HDR10_ST2084 surface format first, and picking it showed a black viewport, because the frames were sRGB. So the driver already offers what PQ presentation needs.
  • Windows: the 10-bit Vulkan viewport is black because the GL/Vulkan interop fails (Windows: 10-bit Vulkan viewport is black (GL/Vulkan interop fails) #150). RV_VULKAN_FORCE_CPU_PRESENT=1 shows the image.

Proposal

  1. A presentation mode preference for Linux and Windows: SDR (today's 10-bit sRGB) and HDR PQ (Rec.2100), with HLG once PQ works. Either generalize macosPresentation or add a sibling preference, with an environment override like UTV_MACOS_PRESENTATION.
  2. Vulkan swapchain:
    • In PQ mode, choose A2B10G10R10/A2R10G10B10 with VK_COLOR_SPACE_HDR10_ST2084_EXT. That needs the VK_EXT_swapchain_colorspace instance extension.
    • Set the mastering and content light levels with VK_EXT_hdr_metadata where the driver offers it.
    • If the surface doesn't offer HDR10, fall back to SDR with a warning, the way a missing 10-bit format falls back to OpenGL today.
  3. OCIO: read_presentation_mode() and the display checks in ocio_source_setup.py read the new preference, so PQ presentation selects Rec.2100-PQ - Display on every platform. The fix(ocio): use the OCIO display in HDR presentation and read file rules on OCIO 2.6 #183 behaviour carries over: with an HDR presentation, the OCIO display is turned on automatically.
  4. UI: the preference sits next to the display bits, and selecting HDR PQ also selects 10-bit output.

Platform requirements

  • Windows:
  • Linux:
    • Wayland only: X11 has no HDR.
    • Needs a compositor with color management (wp_color_management_v1, e.g. KDE Plasma 6) and a Vulkan driver whose Wayland WSI exposes HDR10_ST2084 (recent Mesa, NVIDIA). Which compositor and driver versions work needs checking before this is promised anywhere.
    • On a desktop without HDR, the surface won't list HDR10 and the view stays SDR.

Out of scope

Testing

This has to be tested on real hardware: an HDR display with Windows HDR on (NVIDIA and AMD), and Linux on KDE Plasma 6 under Wayland. CI has no GPU or display. Check:

  • PQ test patterns (e.g. a 1000-nit ramp) appear at the right brightness.
  • A Rec.709 clip and a PNG don't look oversaturated through the PQ display.
  • Turning HDR off on the desktop while UTV is running falls back to SDR cleanly.
  • Moving the window between an HDR and an SDR monitor works.

Activity

  1. added
    enhancement
    on Oct 28, 2026
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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions