Repository navigation
Open
Labels
enhancementNew feature or request
Description
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 theDisplay/macosPresentationpreference orUTV_MACOS_PRESENTATION.ocio_source_setup.py(read_presentation_mode(),PRESENTATION_DISPLAYS) picks the matching OCIO display,Rec.2100-PQ - Displayfor 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.cppdeliberately requiresVK_COLOR_SPACE_SRGB_NONLINEAR_KHR. With HDR on, NVIDIA lists a 10-bitHDR10_ST2084surface 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=1shows the image.
Proposal
- 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
macosPresentationor add a sibling preference, with an environment override likeUTV_MACOS_PRESENTATION. - Vulkan swapchain:
- In PQ mode, choose
A2B10G10R10/A2R10G10B10withVK_COLOR_SPACE_HDR10_ST2084_EXT. That needs theVK_EXT_swapchain_colorspaceinstance extension. - Set the mastering and content light levels with
VK_EXT_hdr_metadatawhere 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.
- In PQ mode, choose
- OCIO:
read_presentation_mode()and the display checks inocio_source_setup.pyread the new preference, so PQ presentation selectsRec.2100-PQ - Displayon 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. - UI: the preference sits next to the display bits, and selecting HDR PQ also selects 10-bit output.
Platform requirements
- Windows:
- Windows HDR has to be on for the display (Settings > Display > Use HDR). NVIDIA and AMD drivers then offer HDR10 surfaces to Vulkan.
- Depends on Windows: 10-bit Vulkan viewport is black (GL/Vulkan interop fails) #150: either the interop works, or UTV switches to the CPU present path automatically when it fails.
- 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 exposesHDR10_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
- Tone mapping HDR footage for SDR presentation (HDR video clips highlights in SDR and EDR presentation: no tone mapping #151).
- EDR-style extended-range presentation on Windows (scRGB /
EXTENDED_SRGB_LINEAR). It could follow later, but OCIO's ACES config targets PQ and HLG displays, not scRGB. - The QRhi renderer (feat(render): port IPCore renderer from OpenGL to QRhi (Metal / Vulkan / D3D12) #70).
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.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity