On Jun 11, 2013, at 21:39 , Nick Zitzmann <n...@chronosnet.com> wrote:
> On Jun 10, 2013, at 10:03 PM, Miguel Pontes <miguelpon...@gmail.com> wrote: > >> Hello, >> I'm having issues getting an app to not trigger switching to the dedicated >> GPU when using NSOpenGLView. > […] >> Is there anything I'm doing wrong? I've read on this mailing list before >> (http://lists.apple.com/archives/cocoa-dev/2011/Mar/msg00795.html) that >> specifying certain pixel formats could cause the discrete GPU to be >> triggered, but I'n not even defining any pixel format when I'm initting the >> NSOpenGLView, just a simple [super initWithFrame:frameRect]. > > No, you're not doing anything wrong. I was curious about this as well, and I > noticed that, starting in 10.8.4, instantiating an IKImageBrowserView will > not toggle the discrete GPU. So I tried to figure out what it was doing, and > found it uses four pixel formats: NSOpenGLPFAAllowOfflineRenderers, > NSOpenGLPFANoRecovery, NSOpenGLPFAAccelerated, and a mysterious pixel format > identified as 1262. > > The first three of the above are standard pixel formats, but the 1262 format > doesn't appear to be documented anywhere. I found out that adding the > undocumented pixel format in addition to the three above apparently prevents > the discrete switch-over from happening. Since it's undocumented, the usual > disclaimers apply: use it at your own risk, it may break in the future, and > all that. > > Nick Zitzmann > <http://www.chronosnet.com/> Actually, I was being dumb. I was failing to set the "NSOpenGLPFAAllowOfflineRenderers" pixel format. You must explicitly set that one for NSOpenGLView to not trigger a GPU change. Just letting it use the defaults won't work. With NSOpenGLPFAAllowOfflineRenderers as a pixel format + NSSupportsAutomaticGraphicsSwitching in the Info.plist, the GPU change isn't triggered. That 1262 format is a nice find, though. It appears that using it as a pixel format makes it ALWAYS use the integrated graphics, even without needing to set NSSupportsAutomaticGraphicsSwitching to YES in the Info.plist. I'm assuming they added that as a private, internal mode in order to make it so programs that use framework classes such as that ImageKit one you mentioned don't indadvertedly switch to discrete graphics when they use them, without the developers needing to go and explicitly modify the plist. Thanks! Miguel Pontes _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com