Skip to content

Commit 6f1a63f

Browse files
committed
Cocoa Port: Support Automatic Graphics Switching, allowing the use of the integrated GPU to run video display windows. (Requires a dual-GPU MacBook Pro with Metal-capable GPUs.)
- While this results in a 20% performance loss for video display window functions (like video filters), this also dramatically extends battery life. To return to the old way of using the discrete GPU for video display windows, the user must disable Automatic Graphics Switching in their System Preferences. - The Troubleshooting Window now correctly reports the emulated 3D renderer that is currently active, rather than the one that is selected in the GUI. - Also fix a bug where creating a OpenGL 3D renderer's context would immediately fall back to Apple Software Renderer if context creation failed. Now, context creation falls back to Apple Software Renderer as the last resort, only after all other Core Profile contexts have failed.
1 parent 25356b7 commit 6f1a63f

File tree

8 files changed

+453
-131
lines changed

8 files changed

+453
-131
lines changed

desmume/src/frontend/cocoa/Info (Debug).plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
<dict>
55
<key>NSRequiresAquaSystemAppearance</key>
66
<false/>
7+
<key>NSSupportsAutomaticGraphicsSwitching</key>
8+
<true/>
79
<key>NSMicrophoneUsageDescription</key>
810
<string>DeSmuME requires your host microphone to emulate the NDS microphone.</string>
911
<key>CFBundleDevelopmentRegion</key>

desmume/src/frontend/cocoa/Info.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
<dict>
55
<key>NSRequiresAquaSystemAppearance</key>
66
<false/>
7+
<key>NSSupportsAutomaticGraphicsSwitching</key>
8+
<true/>
79
<key>NSMicrophoneUsageDescription</key>
810
<string>DeSmuME requires your host microphone to emulate the NDS microphone.</string>
911
<key>CFBundleDevelopmentRegion</key>

desmume/src/frontend/cocoa/cocoa_GPU.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (C) 2013-2022 DeSmuME team
2+
Copyright (C) 2013-2025 DeSmuME team
33
44
This file is free software: you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -238,6 +238,9 @@ class GPUEventHandlerAsync_Stub : public GPUEventHandlerAsync
238238
@property (assign) BOOL layerSubOBJ;
239239

240240
@property (assign) NSInteger render3DRenderingEngine;
241+
@property (readonly) NSInteger render3DRenderingEngineApplied;
242+
@property (readonly) NSInteger render3DRenderingEngineAppliedHostRendererID;
243+
@property (readonly) NSString *render3DRenderingEngineAppliedHostRendererName;
241244
@property (assign) BOOL render3DHighPrecisionColorInterpolation;
242245
@property (assign) BOOL render3DEdgeMarking;
243246
@property (assign) BOOL render3DFog;
@@ -261,7 +264,6 @@ class GPUEventHandlerAsync_Stub : public GPUEventHandlerAsync
261264
#endif
262265

263266
- (BOOL) gpuStateByBit:(const UInt32)stateBit;
264-
- (NSString *) render3DRenderingEngineString;
265267
- (void) clearWithColor:(const uint16_t)colorBGRA5551;
266268
- (void) respondToPauseState:(BOOL)isPaused;
267269

0 commit comments

Comments
 (0)