Skip to content

Apple: Support output to EDR (HDR) displays #106814

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

stuartcarnie
Copy link
Contributor

@stuartcarnie stuartcarnie commented May 26, 2025

Add support for EDR displays to Apple platforms.

Depends on

Implements godotengine/godot-proposals#10817 for Apple platforms
Testing/Sample project: https://github.com/DarkKilauea/godot-hdr-output

  • 64-bit (RGBA 16-bit float) and 32-bit (RGB10A2 10-bit / 2-bit)
  • Metal renderer and context updated
  • Vulkan support tested
  • macOS display driver
  • macOS embedded display driver
  • Apple Embedded display driver

Note

Apple's HDR Content page is also useful.

In particular, Understanding EDR Values:

On Macs that support EDR, a 1.0 value for a pixel corresponds to the maximum standard dynamic range (SDR) brightness level, but this brightness level doesn’t have to correspond to the maximum brightness of the display. If the display can produce higher brightness levels, additional range (headroom) may be available. The amount of headroom may vary, depending on the actual display characteristics:

  • If the UI brightness level is at 100 nits and the panel is capable of a maximum brightness of 400 nits, then enabling EDR allows values up to 4.0 to be displayed at 400 nits.
  • On the same panel, if the user adjusts the UI brightness level to 200 nits, then 1.0 values are displayed at 200 nits, and 2.0 values are at 400 nits.

Issues:

  • When a new window (popup, settings, etc) is created, with HDR support enabled, it is rendered incorrectly

The issue is the changes to the RenderCompositorRD (_ensure_blit_pipelines specifically) assume the blit pipelines are the same for all windows by using the MAIN_WINDOW_ID as the reference. This is not the case (at least on macOS) if the main window is HDR (RGBA 16-bit float) and the popup window is SDR (RGBA8 UNORM). This happens for both the Metal and Vulkan renderers.

CleanShot 2025-05-27 at 08 12 54@2x

Co-authored-by: Alvin Wong <alvinhochun@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants