[macos] allow using the integrated GPU on dual-GPU machines

This commit is contained in:
Konstantin Käfer
2017-01-24 22:08:17 +01:00
parent af0ff55f16
commit b5bc4fd8b4
3 changed files with 5 additions and 0 deletions

View File

@@ -20,6 +20,8 @@ HeadlessDisplay::Impl::Impl() {
CGLPixelFormatAttribute attributes[] = {
kCGLPFAOpenGLProfile,
static_cast<CGLPixelFormatAttribute>(kCGLOGLPVersion_Legacy),
kCGLPFASupportsAutomaticGraphicsSwitching,
kCGLPFAAllowOfflineRenderers, // Allows using the integrated GPU
static_cast<CGLPixelFormatAttribute>(0)
};

View File

@@ -52,5 +52,7 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSSupportsAutomaticGraphicsSwitching</key>
<true/>
</dict>
</plist>

View File

@@ -30,6 +30,7 @@
NSOpenGLPFADepthSize, 16,
NSOpenGLPFAStencilSize, 8,
NSOpenGLPFAScreenMask, mask,
NSOpenGLPFAAllowOfflineRenderers, // Allows using the integrated GPU
0
};
return [[NSOpenGLPixelFormat alloc] initWithAttributes:pfas];