Skip to content

fix(utils): fix GetHDREnabled fallback check that mistakes WCG for HDR - #728

Open
SERGEYDJUM wants to merge 1 commit into
clshortfuse:mainfrom
SERGEYDJUM:fix-swapchain-get-hdr-enabled
Open

SERGEYDJUM wants to merge 1 commit into
clshortfuse:mainfrom
SERGEYDJUM:fix-swapchain-get-hdr-enabled

Conversation

@SERGEYDJUM

Copy link
Copy Markdown

On old Windows builds, the GetHDREnabled function relies on the value of the advancedColorEnabled flag in DISPLAYCONFIG_GET_ADVANCED_COLOR_INFO struct as a fallback. When user toggles HDR off (with a Win + Alt + B shortcut), some (possibly most) displays start to output wide gamut SDR that still counts as advanced color and the flag stays enabled. Meaning, advancedColorEnabled cannot reliably discriminate between HDR and not-HDR.

One of my own projects relies on an HDR check adapted from GetHDREnabled. I received a report from a Windows 11 23H2 user that encountered an issue that stems from the problem above.

After some tests, I learned that another flag (wideColorEnforced) does change when toggling HDR. Meaning, advancedColorEnabled && !wideColorEnforced can act as an indicator of HDR. I cannot say that the new fallback is reliable, but it's arguably better.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant