diff --git a/src/gui/rhi/qrhi.cpp b/src/gui/rhi/qrhi.cpp index 58bbc349419..f2e899651bd 100644 --- a/src/gui/rhi/qrhi.cpp +++ b/src/gui/rhi/qrhi.cpp @@ -7256,12 +7256,13 @@ QRhiRenderTarget *QRhiSwapChain::currentFrameRenderTarget(StereoTargetBuffer tar } luminanceInNits; \endcode - Whereas for macOS/iOS, the maximum color component value (e.g. supposedly - something larger than 1.0f) is provided: + Whereas for macOS/iOS, the current maximum and potential maximum color + component values are provided: \code struct { float maxColorComponentValue; + float maxPotentialColorComponentValue; } colorComponentValue; \endcode @@ -7306,6 +7307,7 @@ QDebug operator<<(QDebug dbg, const QRhiSwapChainHdrInfo &info) break; case QRhiSwapChainHdrInfo::ColorComponentValue: dbg.nospace() << " maxColorComponentValue=" << info.limits.colorComponentValue.maxColorComponentValue; + dbg.nospace() << " maxPotentialColorComponentValue=" << info.limits.colorComponentValue.maxPotentialColorComponentValue; break; } dbg.nospace() << ')'; diff --git a/src/gui/rhi/qrhi.h b/src/gui/rhi/qrhi.h index 8ec6630acfe..eb300f5873b 100644 --- a/src/gui/rhi/qrhi.h +++ b/src/gui/rhi/qrhi.h @@ -1485,6 +1485,7 @@ struct QRhiSwapChainHdrInfo } luminanceInNits; struct { float maxColorComponentValue; + float maxPotentialColorComponentValue; } colorComponentValue; } limits; }; diff --git a/src/gui/rhi/qrhimetal.mm b/src/gui/rhi/qrhimetal.mm index 4edf0ac865e..4a4da81b862 100644 --- a/src/gui/rhi/qrhimetal.mm +++ b/src/gui/rhi/qrhimetal.mm @@ -6338,12 +6338,16 @@ QRhiSwapChainHdrInfo QMetalSwapChain::hdrInfo() // Must use m_window, not window, given this may be called before createOrResize(). #ifdef Q_OS_MACOS NSView *view = reinterpret_cast(m_window->winId()); - info.limits.colorComponentValue.maxColorComponentValue = view.window.screen.maximumExtendedDynamicRangeColorComponentValue; + NSScreen *screen = view.window.screen; + info.limits.colorComponentValue.maxColorComponentValue = screen.maximumExtendedDynamicRangeColorComponentValue; + info.limits.colorComponentValue.maxPotentialColorComponentValue = screen.maximumPotentialExtendedDynamicRangeColorComponentValue; info.isHardCodedDefaults = false; #else if (@available(iOS 16.0, *)) { UIView *view = reinterpret_cast(m_window->winId()); + UIScreen *screen = view.window.windowScene.screen; info.limits.colorComponentValue.maxColorComponentValue = view.window.windowScene.screen.currentEDRHeadroom; + info.limits.colorComponentValue.maxPotentialColorComponentValue = screen.potentialEDRHeadroom; info.isHardCodedDefaults = false; } #endif