mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Add HDR to Metal
This commit is contained in:
@ -164,8 +164,23 @@ void Metal::VideoBackend::PrepareWindow(WindowSystemInfo& wsi)
|
||||
return;
|
||||
NSView* view = static_cast<NSView*>(wsi.render_surface);
|
||||
CAMetalLayer* layer = [CAMetalLayer layer];
|
||||
|
||||
Util::PopulateBackendInfo(&g_Config);
|
||||
|
||||
if (g_Config.backend_info.bSupportsHDROutput && g_Config.bHDR)
|
||||
{
|
||||
[layer setWantsExtendedDynamicRangeContent:YES];
|
||||
[layer setPixelFormat:MTLPixelFormatRGBA16Float];
|
||||
|
||||
const CFStringRef name = kCGColorSpaceExtendedLinearSRGB;
|
||||
CGColorSpaceRef colorspace = CGColorSpaceCreateWithName(name);
|
||||
[layer setColorspace:colorspace];
|
||||
CGColorSpaceRelease(colorspace);
|
||||
}
|
||||
|
||||
[view setWantsLayer:YES];
|
||||
[view setLayer:layer];
|
||||
|
||||
wsi.render_surface = layer;
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user