Metal: after experimenting with EDR tone-mapping, it's here but disabled. It's unclear how best to render content from Windows. We get the system calibration peak nits in the Mastering Display Color Volume metadata, but this won't apply to most content.
This commit is contained in:
@@ -1016,33 +1016,7 @@ int DrSubmitDecodeUnit(PDECODE_UNIT decodeUnit);
|
||||
|
||||
- (void)getAllStats:(video_stats_t *)stats {
|
||||
if (_renderingBackend == RENDER_METAL) {
|
||||
#if TARGET_OS_OSX
|
||||
float edrHeadroom = [[NSScreen mainScreen] maximumExtendedDynamicRangeColorComponentValue];
|
||||
#else
|
||||
float edrHeadroom = [[UIScreen mainScreen] currentEDRHeadroom];
|
||||
UIScreenReferenceDisplayModeStatus referenceStatus = [[UIScreen mainScreen] referenceDisplayModeStatus];
|
||||
#endif
|
||||
if (edrHeadroom > 1.0) {
|
||||
NSString *ref;
|
||||
// Device has a reference display that may or may not be enabled
|
||||
switch (referenceStatus) {
|
||||
case UIScreenReferenceDisplayModeStatusLimited:
|
||||
ref = @"(Reference mode limited),";
|
||||
break;
|
||||
case UIScreenReferenceDisplayModeStatusEnabled:
|
||||
ref = @"(Reference mode),";
|
||||
break;
|
||||
default:
|
||||
ref = @",";
|
||||
break;
|
||||
}
|
||||
int peakNits = 1000;
|
||||
stats->renderingBackendString = [NSString stringWithFormat:@"Metal, EDR %.1f %@ tone-mapped: %d nits",
|
||||
edrHeadroom, ref, peakNits];
|
||||
} else {
|
||||
// if HDR
|
||||
stats->renderingBackendString = [NSString stringWithFormat:@"Metal, tone-mapped: HDR->sRGB"];
|
||||
}
|
||||
stats->renderingBackendString = [NSString stringWithFormat:@"Metal, colorspace: %@", [MetalVideoRenderer currentColorSpace]];
|
||||
} else {
|
||||
stats->renderingBackendString = @"AVSampleBuffer";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user