rhi: Enable HDRExtendedSrgbLinear for iOS
Change-Id: Iaff3c0d18c07cc0cd4ed57a8e6fa7fb07b130a58 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit 95d10ae682f1e6e67927166c3b04adc39f6aee23) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
b36eaa3989
commit
61d7831405
@ -6105,9 +6105,12 @@ QSize QMetalSwapChain::surfacePixelSize()
|
|||||||
|
|
||||||
bool QMetalSwapChain::isFormatSupported(Format f)
|
bool QMetalSwapChain::isFormatSupported(Format f)
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_MACOS
|
if (f == HDRExtendedSrgbLinear) {
|
||||||
return f == SDR || f == HDRExtendedSrgbLinear;
|
if (@available(macOS 10.11, iOS 16.0, *))
|
||||||
#endif
|
return true;
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return f == SDR;
|
return f == SDR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6189,13 +6192,13 @@ bool QMetalSwapChain::createOrResize()
|
|||||||
chooseFormats();
|
chooseFormats();
|
||||||
if (d->colorFormat != d->layer.pixelFormat)
|
if (d->colorFormat != d->layer.pixelFormat)
|
||||||
d->layer.pixelFormat = d->colorFormat;
|
d->layer.pixelFormat = d->colorFormat;
|
||||||
#ifdef Q_OS_MACOS
|
|
||||||
// Can't enable this on iOS until wantsExtendedDynamicRangeContent is available
|
|
||||||
if (m_format == HDRExtendedSrgbLinear) {
|
if (m_format == HDRExtendedSrgbLinear) {
|
||||||
d->layer.colorspace = CGColorSpaceCreateWithName(kCGColorSpaceExtendedLinearSRGB);
|
if (@available(macOS 10.11, iOS 16.0, *)) {
|
||||||
d->layer.wantsExtendedDynamicRangeContent = YES;
|
d->layer.colorspace = CGColorSpaceCreateWithName(kCGColorSpaceExtendedLinearSRGB);
|
||||||
|
d->layer.wantsExtendedDynamicRangeContent = YES;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (m_flags.testFlag(UsedAsTransferSource))
|
if (m_flags.testFlag(UsedAsTransferSource))
|
||||||
d->layer.framebufferOnly = NO;
|
d->layer.framebufferOnly = NO;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user