Repository navigation
feat: HDR / EDR has an Auto choice: on where the window's screen can show HDR, off elsewhere - #2222
Open
1395490241lhj-code wants to merge 1 commit into
Open
1395490241lhj-code wants to merge 1 commit into
1395490241lhj-code wants to merge 1 commit into
Conversation
…show HDR, off elsewhere The HDR / EDR switch (PR ly05010419#1129; Tears of the Kingdom 1.4.3 on the Mac) stays on wherever the window is. On an SDR monitor that still presents through the float surface, re-grades the picture, costs GPU time (here 8.1 -> 10.7 ms a frame at the Temple of Time, 2560x1440 + MetalFX) and keeps frame interpolation off. A MacBook with an XDR screen and an SDR monitor therefore needs the switch flipped every time the window changes screen. The row is now Off / Auto / On. Auto is the same switch, on while the window's screen can show more than SDR white (NSScreen maximumPotentialExtendedDynamicRangeColorComponentValue above 1) and off elsewhere: on the SDR monitor the picture, the cost and frame interpolation are those of Off. It follows the window when it changes screen and a screen whose HDR is turned on or off, through the path the row already uses (front_hdr_update, the renderer's per-frame latch). - games/totk/runtime/hdr_auto.h: the words, TOTK_HDR's precedence and what a choice means on a screen (plain C). - hdr.txt holds off / on / auto. TOTK_HDR=auto is auto; TOTK_HDR=1 is on and any other value off, as before. - The default is still off; Off and On are unchanged on every screen. Builds without HDR are unchanged. - The row's order is Off / Auto / On, so a controller stepping from Off reaches Auto without passing On, which turns frame interpolation off. Auto keeps the interpolation choice; picking interpolation while HDR is on turns HDR off, as before. Tests: tests/test_hdr_auto.c (make check-c) for the words and precedence; the settings probe's new `hdr` mode (tests/test_hdr_auto.py; no window, the screen's value comes from the probe) for the start, a window moving between an SDR and an HDR screen with frame interpolation, the saved word and the row, built as 1.2.1, 1.4.3 and Breath of the Wild 1.9.0. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The HDR / EDR row (PR #1129; Tears of the Kingdom 1.4.3 on the Mac) becomes Off / Auto / On.
Auto is the same switch, on while the window's screen can show more than SDR white
(
NSScreen.maximumPotentialExtendedDynamicRangeColorComponentValue > 1) and off everywhere else. It follows the windowwhen it changes screen, and a screen whose HDR is turned on or off in System Settings.
Why
On stays on wherever the window is. On an SDR monitor it still presents through the float surface, re-grades the
picture, costs GPU time and keeps frame interpolation off. A MacBook with an XDR screen and an SDR monitor needs the
switch flipped every time the window changes screen. With Auto, the SDR monitor gets exactly the Off path.
What does not change
TOTK_HDR=1is on and wins overhdr.txt; any other value is off, as before. New:TOTK_HDR=auto, andautoinhdr.txt.interpolation choice, which runs wherever Auto leaves HDR off.
would turn interpolation off on the way).
How
games/totk/runtime/hdr_auto.h(plain C): the three words,TOTK_HDR's precedence, what a choice means on a screen.frontend.m:hdrChoicebesidehdrEnabled.front_hdr_update(the start, window screen / backing changes, theexisting 0.5 s timer, the row) sets
hdrEnabledfrom the choice on the window's screen; everything that reads theswitch (the renderer's per-frame latch,
mfx_latch) is untouched.settings_panel.h: the row.Tests
tests/test_hdr_auto.c(inC_TESTS,make check-c): words and precedence.hdrmode (no window; the screen's value comes from the probe), run bytests/test_hdr_auto.pyfor 1.2.1, 1.4.3 and Breath of the Wild 1.9.0: the start fromTOTK_HDR/hdr.txt, a windowmoving between an SDR and an HDR screen with frame interpolation requested, the saved word, the row.
python -m unittest discover -s tests: 1694 tests, 4 failures, the same 4 on 49ff9ec without this change(
test_texture_copy_gpu,test_shader_startup_memory,test_smaa,test_updates...test_running_app_is_preserved_until_its_process_exits).make check-cpasses.Tested on a Mac
MacBook Pro (M5 Pro, macOS 27.3) with its XDR screen (potential EDR 16) and an LG monitor with HDR off in macOS
(potential EDR 1). Tears of the Kingdom 1.4.3, scripted sessions (no hand play): start, title, load a save at the Temple
of Time, 30 s standing there, 2560x1440 + MetalFX. Runtime-only update of an existing app (
update_runtime.py)."GPU" is the median GPU time of a frame over the last 25 s.
[hdr] auto: Built-in Retina Display, potential EDR 16.00: HDR on, the surface goes on.TOTK_MFX=interp60: the interpolator runs (every game frame interpolated in the world). Thesame on the XDR screen:
frame interpolation 60+60 -> off, as with On.no failure line.
The runs that name a screen used a test-only window placement aid in
frontend.m(not in this PR); the PR builditself was also run with Off, On and Auto.
Not done
frontend.mpasses a syntax check with each of the seven game binaries' flags; only the 1.4.3app was built and run. iOS does not compile the touched files (
frontend.mis excluded inios/project.yml).🤖 Generated with Claude Code