mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-09-23 17:58:44 +00:00
Add HDR to Metal
This commit is contained in:
parent
f3d1cda672
commit
153d0201a8
3 changed files with 19 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue