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.
This commit is contained in:
parent
25356b70f1
commit
6f1a63fe89
|
@ -4,6 +4,8 @@
|
|||
<dict>
|
||||
<key>NSRequiresAquaSystemAppearance</key>
|
||||
<false/>
|
||||
<key>NSSupportsAutomaticGraphicsSwitching</key>
|
||||
<true/>
|
||||
<key>NSMicrophoneUsageDescription</key>
|
||||
<string>DeSmuME requires your host microphone to emulate the NDS microphone.</string>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
<dict>
|
||||
<key>NSRequiresAquaSystemAppearance</key>
|
||||
<false/>
|
||||
<key>NSSupportsAutomaticGraphicsSwitching</key>
|
||||
<true/>
|
||||
<key>NSMicrophoneUsageDescription</key>
|
||||
<string>DeSmuME requires your host microphone to emulate the NDS microphone.</string>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright (C) 2013-2022 DeSmuME team
|
||||
Copyright (C) 2013-2025 DeSmuME team
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -238,6 +238,9 @@ public:
|
|||
@property (assign) BOOL layerSubOBJ;
|
||||
|
||||
@property (assign) NSInteger render3DRenderingEngine;
|
||||
@property (readonly) NSInteger render3DRenderingEngineApplied;
|
||||
@property (readonly) NSInteger render3DRenderingEngineAppliedHostRendererID;
|
||||
@property (readonly) NSString *render3DRenderingEngineAppliedHostRendererName;
|
||||
@property (assign) BOOL render3DHighPrecisionColorInterpolation;
|
||||
@property (assign) BOOL render3DEdgeMarking;
|
||||
@property (assign) BOOL render3DFog;
|
||||
|
@ -261,7 +264,6 @@ public:
|
|||
#endif
|
||||
|
||||
- (BOOL) gpuStateByBit:(const UInt32)stateBit;
|
||||
- (NSString *) render3DRenderingEngineString;
|
||||
- (void) clearWithColor:(const uint16_t)colorBGRA5551;
|
||||
- (void) respondToPauseState:(BOOL)isPaused;
|
||||
|
||||
|
|
|
@ -16,6 +16,10 @@
|
|||
*/
|
||||
|
||||
#import "cocoa_GPU.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
#import "cocoa_output.h"
|
||||
#import "cocoa_globals.h"
|
||||
#include "utilities.h"
|
||||
|
@ -51,6 +55,9 @@ GPU3DInterface *core3DList[GPU_3D_RENDERER_COUNT+1] = {
|
|||
NULL
|
||||
};
|
||||
|
||||
int __hostRendererID = -1;
|
||||
char __hostRendererString[256] = {0};
|
||||
|
||||
@implementation CocoaDSGPU
|
||||
|
||||
@dynamic gpuStateFlags;
|
||||
|
@ -74,6 +81,9 @@ GPU3DInterface *core3DList[GPU_3D_RENDERER_COUNT+1] = {
|
|||
@dynamic layerSubOBJ;
|
||||
|
||||
@dynamic render3DRenderingEngine;
|
||||
@dynamic render3DRenderingEngineApplied;
|
||||
@dynamic render3DRenderingEngineAppliedHostRendererID;
|
||||
@dynamic render3DRenderingEngineAppliedHostRendererName;
|
||||
@dynamic render3DHighPrecisionColorInterpolation;
|
||||
@dynamic render3DEdgeMarking;
|
||||
@dynamic render3DFog;
|
||||
|
@ -396,6 +406,88 @@ GPU3DInterface *core3DList[GPU_3D_RENDERER_COUNT+1] = {
|
|||
return rendererID;
|
||||
}
|
||||
|
||||
- (NSInteger) render3DRenderingEngineApplied
|
||||
{
|
||||
gpuEvent->ApplyRender3DSettingsLock();
|
||||
if ( (gpu3D == NULL) || (CurrentRenderer == NULL) )
|
||||
{
|
||||
gpuEvent->ApplyRender3DSettingsUnlock();
|
||||
return 0;
|
||||
}
|
||||
|
||||
const NSInteger rendererID = (NSInteger)CurrentRenderer->GetRenderID();
|
||||
gpuEvent->ApplyRender3DSettingsUnlock();
|
||||
|
||||
return rendererID;
|
||||
}
|
||||
|
||||
- (NSInteger) render3DRenderingEngineAppliedHostRendererID
|
||||
{
|
||||
NSInteger hostID = 0;
|
||||
|
||||
gpuEvent->ApplyRender3DSettingsLock();
|
||||
|
||||
if ( (gpu3D == NULL) || (CurrentRenderer == NULL) )
|
||||
{
|
||||
gpuEvent->ApplyRender3DSettingsUnlock();
|
||||
return hostID;
|
||||
}
|
||||
|
||||
switch (CurrentRenderer->GetRenderID())
|
||||
{
|
||||
case RENDERID_OPENGL_AUTO:
|
||||
case RENDERID_OPENGL_LEGACY:
|
||||
case RENDERID_OPENGL_3_2:
|
||||
hostID = (NSInteger)__hostRendererID;
|
||||
break;
|
||||
|
||||
case RENDERID_NULL:
|
||||
case RENDERID_SOFTRASTERIZER:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
gpuEvent->ApplyRender3DSettingsUnlock();
|
||||
|
||||
return hostID;
|
||||
}
|
||||
|
||||
- (NSString *) render3DRenderingEngineAppliedHostRendererName
|
||||
{
|
||||
NSString *theString = @"Uninitialized";
|
||||
|
||||
gpuEvent->ApplyRender3DSettingsLock();
|
||||
|
||||
if ( (gpu3D == NULL) || (CurrentRenderer == NULL) )
|
||||
{
|
||||
gpuEvent->ApplyRender3DSettingsUnlock();
|
||||
return theString;
|
||||
}
|
||||
|
||||
std::string theName;
|
||||
|
||||
switch (CurrentRenderer->GetRenderID())
|
||||
{
|
||||
case RENDERID_OPENGL_AUTO:
|
||||
case RENDERID_OPENGL_LEGACY:
|
||||
case RENDERID_OPENGL_3_2:
|
||||
theName = std::string((const char *)__hostRendererString);
|
||||
break;
|
||||
|
||||
case RENDERID_NULL:
|
||||
case RENDERID_SOFTRASTERIZER:
|
||||
default:
|
||||
theName = CurrentRenderer->GetName();
|
||||
break;
|
||||
}
|
||||
|
||||
theString = [NSString stringWithCString:theName.c_str() encoding:NSUTF8StringEncoding];
|
||||
|
||||
gpuEvent->ApplyRender3DSettingsUnlock();
|
||||
|
||||
return theString;
|
||||
}
|
||||
|
||||
- (void) setRender3DHighPrecisionColorInterpolation:(BOOL)state
|
||||
{
|
||||
gpuEvent->ApplyRender3DSettingsLock();
|
||||
|
@ -1020,26 +1112,6 @@ GPU3DInterface *core3DList[GPU_3D_RENDERER_COUNT+1] = {
|
|||
return ([self gpuStateFlags] & (1 << stateBit)) ? YES : NO;
|
||||
}
|
||||
|
||||
- (NSString *) render3DRenderingEngineString
|
||||
{
|
||||
NSString *theString = @"Uninitialized";
|
||||
|
||||
gpuEvent->ApplyRender3DSettingsLock();
|
||||
|
||||
if (gpu3D == NULL)
|
||||
{
|
||||
gpuEvent->ApplyRender3DSettingsUnlock();
|
||||
return theString;
|
||||
}
|
||||
|
||||
const char *theName = gpu3D->name;
|
||||
theString = [NSString stringWithCString:theName encoding:NSUTF8StringEncoding];
|
||||
|
||||
gpuEvent->ApplyRender3DSettingsUnlock();
|
||||
|
||||
return theString;
|
||||
}
|
||||
|
||||
- (void) clearWithColor:(const uint16_t)colorBGRA5551
|
||||
{
|
||||
gpuEvent->FramebufferLock();
|
||||
|
@ -1834,24 +1906,31 @@ bool GPUEventHandlerAsync::GetRender3DNeedsFinish()
|
|||
#define kCGLOGLPVersion_GL4_Core 0x4100
|
||||
#endif
|
||||
|
||||
#if !defined(MAC_OS_X_VERSION_10_13)
|
||||
#define kCGLRPRemovable (CGLRendererProperty)142
|
||||
#endif
|
||||
|
||||
CGLContextObj OSXOpenGLRendererContext = NULL;
|
||||
CGLContextObj OSXOpenGLRendererContextPrev = NULL;
|
||||
SILENCE_DEPRECATION_MACOS_10_7( CGLPBufferObj OSXOpenGLRendererPBuffer = NULL );
|
||||
|
||||
// Struct to hold renderer info
|
||||
struct GLRendererInfo
|
||||
struct HostRendererInfo
|
||||
{
|
||||
GLint rendererID; // Renderer ID, used to associate a renderer with a display device or virtual screen
|
||||
GLint accelerated; // Hardware acceleration flag, 0 = Software only, 1 = Has hardware acceleration
|
||||
GLint displayID; // Display ID, used to associate a display device with a renderer
|
||||
GLint online; // Online flag, 0 = No display device associated, 1 = Display device associated
|
||||
GLint virtualScreen; // Virtual screen index, used to associate a virtual screen with a renderer
|
||||
GLint videoMemoryMB; // The total amount of VRAM available to this renderer
|
||||
GLint textureMemoryMB; // The amount of VRAM available to this renderer for texture usage
|
||||
const GLubyte *vendorStr; // The OpenGL GL_VENDOR string
|
||||
const GLubyte *rendererStr; // The OpenGL GL_RENDERER string
|
||||
int32_t rendererID; // Renderer ID, used to associate a renderer with a display device or virtual screen
|
||||
int32_t accelerated; // Hardware acceleration flag, 0 = Software only, 1 = Has hardware acceleration
|
||||
int32_t displayID; // Display ID, used to associate a display device with a renderer
|
||||
int32_t online; // Online flag, 0 = No display device associated, 1 = Display device associated
|
||||
int32_t removable; // Removable flag, used to indicate if the renderer is removable (like an eGPU), 0 = Fixed, 1 = Removable
|
||||
int32_t virtualScreen; // Virtual screen index, used to associate a virtual screen with a renderer
|
||||
int32_t videoMemoryMB; // The total amount of VRAM available to this renderer
|
||||
int32_t textureMemoryMB; // The amount of VRAM available to this renderer for texture usage
|
||||
char vendor[256]; // C-string copy of the host renderer's vendor
|
||||
char name[256]; // C-string copy of the host renderer's name
|
||||
const void *vendorStr; // Pointer to host renderer's vendor string (parsing this is implementation dependent)
|
||||
const void *nameStr; // Pointer to host renderer's name string (parsing this is implementation dependent)
|
||||
};
|
||||
typedef struct GLRendererInfo GLRendererInfo;
|
||||
typedef struct HostRendererInfo HostRendererInfo;
|
||||
|
||||
static bool __cgl_initOpenGL(const int requestedProfile)
|
||||
{
|
||||
|
@ -1877,6 +1956,12 @@ static bool __cgl_initOpenGL(const int requestedProfile)
|
|||
return result;
|
||||
}
|
||||
|
||||
const bool isHighSierraSupported = IsOSXVersionSupported(10, 13, 0);
|
||||
const bool isMavericksSupported = (isHighSierraSupported || IsOSXVersionSupported(10, 9, 0));
|
||||
const bool isMountainLionSupported = (isMavericksSupported || IsOSXVersionSupported(10, 8, 0));
|
||||
const bool isLionSupported = (isMountainLionSupported || IsOSXVersionSupported(10, 7, 0));
|
||||
const bool isLeopardSupported = (isLionSupported || IsOSXVersionSupported(10, 5, 0));
|
||||
|
||||
CGLPixelFormatAttribute attrs[] = {
|
||||
kCGLPFAColorSize, (CGLPixelFormatAttribute)24,
|
||||
kCGLPFAAlphaSize, (CGLPixelFormatAttribute)8,
|
||||
|
@ -1891,7 +1976,7 @@ static bool __cgl_initOpenGL(const int requestedProfile)
|
|||
|
||||
if (requestedProfile == kCGLOGLPVersion_GL4_Core)
|
||||
{
|
||||
if (IsOSXVersionSupported(10, 9, 0))
|
||||
if (isMavericksSupported)
|
||||
{
|
||||
attrs[5] = (CGLPixelFormatAttribute)0; // We'll be using FBOs instead of the default framebuffer.
|
||||
attrs[7] = (CGLPixelFormatAttribute)0; // We'll be using FBOs instead of the default framebuffer.
|
||||
|
@ -1908,7 +1993,7 @@ static bool __cgl_initOpenGL(const int requestedProfile)
|
|||
// As of 2021/09/03, testing has shown that macOS v10.7's OpenGL 3.2 shader
|
||||
// compiler isn't very reliable, and so we're going to require macOS v10.8
|
||||
// instead, which at least has a working shader compiler for OpenGL 3.2.
|
||||
if (IsOSXVersionSupported(10, 8, 0))
|
||||
if (isMountainLionSupported)
|
||||
{
|
||||
attrs[5] = (CGLPixelFormatAttribute)0; // We'll be using FBOs instead of the default framebuffer.
|
||||
attrs[7] = (CGLPixelFormatAttribute)0; // We'll be using FBOs instead of the default framebuffer.
|
||||
|
@ -1920,7 +2005,7 @@ static bool __cgl_initOpenGL(const int requestedProfile)
|
|||
return result;
|
||||
}
|
||||
}
|
||||
else if (IsOSXVersionSupported(10, 7, 0))
|
||||
else if (isLionSupported)
|
||||
{
|
||||
attrs[9] = (CGLPixelFormatAttribute)kCGLOGLPVersion_Legacy;
|
||||
}
|
||||
|
@ -1940,8 +2025,21 @@ static bool __cgl_initOpenGL(const int requestedProfile)
|
|||
CGLChoosePixelFormat(attrs, &cglPixFormat, &virtualScreenCount);
|
||||
if (cglPixFormat == NULL)
|
||||
{
|
||||
// Remove the HW rendering requirement and try again. Note that this will
|
||||
// result in SW rendering, which will cause a substantial speed hit.
|
||||
if (requestedProfile == kCGLOGLPVersion_GL4_Core)
|
||||
{
|
||||
// OpenGL 4.1 Core Profile requires hardware acceleration. Bail if we can't find a renderer that supports both.
|
||||
fprintf(stderr, "%s: This system has no HW-accelerated renderers that support 4.1 Core Profile.\n", ctxString);
|
||||
return result;
|
||||
}
|
||||
else if (requestedProfile == kCGLOGLPVersion_3_2_Core)
|
||||
{
|
||||
// OpenGL 3.2 Core Profile requires hardware acceleration. Bail if we can't find a renderer that supports both.
|
||||
fprintf(stderr, "%s: This system has no HW-accelerated renderers that support 3.2 Core Profile.\n", ctxString);
|
||||
return result;
|
||||
}
|
||||
|
||||
// For Legacy OpenGL, we'll allow fallback to the Apple Software Renderer.
|
||||
// However, doing this will result in a substantial performance loss.
|
||||
if (attrs[8] == kCGLPFAAccelerated)
|
||||
{
|
||||
attrs[8] = (CGLPixelFormatAttribute)0;
|
||||
|
@ -1958,9 +2056,14 @@ static bool __cgl_initOpenGL(const int requestedProfile)
|
|||
error = CGLChoosePixelFormat(attrs, &cglPixFormat, &virtualScreenCount);
|
||||
if (error != kCGLNoError)
|
||||
{
|
||||
// We shouldn't fail at this point, but we're including this to account for all code paths.
|
||||
fprintf(stderr, "%s: Failed to create the pixel format structure: %i\n", ctxString, (int)error);
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("WARNING: No HW-accelerated renderers were found -- falling back to Apple Software Renderer.\n This will result in a substantial performance loss.");
|
||||
}
|
||||
}
|
||||
|
||||
// Create the OpenGL context using our pixel format, and then save the default assigned virtual screen.
|
||||
|
@ -1983,39 +2086,38 @@ static bool __cgl_initOpenGL(const int requestedProfile)
|
|||
GLint rendererCount = 0;
|
||||
CGLQueryRendererInfo(0xFFFFFFFF, &cglRendererInfo, &rendererCount);
|
||||
|
||||
GLRendererInfo *rendererInfo = (GLRendererInfo *)malloc(sizeof(GLRendererInfo) * rendererCount);
|
||||
memset(rendererInfo, 0, sizeof(GLRendererInfo) * rendererCount);
|
||||
HostRendererInfo *rendererInfo = (HostRendererInfo *)malloc(sizeof(HostRendererInfo) * rendererCount);
|
||||
memset(rendererInfo, 0, sizeof(HostRendererInfo) * rendererCount);
|
||||
|
||||
if (IsOSXVersionSupported(10, 7, 0))
|
||||
if (isLeopardSupported)
|
||||
{
|
||||
for (GLint i = 0; i < rendererCount; i++)
|
||||
{
|
||||
GLRendererInfo &info = rendererInfo[i];
|
||||
|
||||
CGLDescribeRenderer(cglRendererInfo, i, kCGLRPOnline, &(info.online));
|
||||
CGLDescribeRenderer(cglRendererInfo, i, kCGLRPDisplayMask, &(info.displayID));
|
||||
rendererInfo[i].displayID = (GLint)CGOpenGLDisplayMaskToDisplayID(info.displayID);
|
||||
CGLDescribeRenderer(cglRendererInfo, i, kCGLRPAccelerated, &(info.accelerated));
|
||||
CGLDescribeRenderer(cglRendererInfo, i, kCGLRPRendererID, &(info.rendererID));
|
||||
CGLDescribeRenderer(cglRendererInfo, i, kCGLRPVideoMemoryMegabytes, &(info.videoMemoryMB));
|
||||
CGLDescribeRenderer(cglRendererInfo, i, kCGLRPTextureMemoryMegabytes, &(info.textureMemoryMB));
|
||||
}
|
||||
}
|
||||
else if (IsOSXVersionSupported(10, 5, 0))
|
||||
{
|
||||
for (GLint i = 0; i < rendererCount; i++)
|
||||
{
|
||||
GLRendererInfo &info = rendererInfo[i];
|
||||
HostRendererInfo &info = rendererInfo[i];
|
||||
|
||||
CGLDescribeRenderer(cglRendererInfo, i, kCGLRPOnline, &(info.online));
|
||||
CGLDescribeRenderer(cglRendererInfo, i, kCGLRPDisplayMask, &(info.displayID));
|
||||
info.displayID = (GLint)CGOpenGLDisplayMaskToDisplayID(info.displayID);
|
||||
CGLDescribeRenderer(cglRendererInfo, i, kCGLRPAccelerated, &(info.accelerated));
|
||||
CGLDescribeRenderer(cglRendererInfo, i, kCGLRPRendererID, &(info.rendererID));
|
||||
CGLDescribeRenderer(cglRendererInfo, i, kCGLRPVideoMemory, &(info.videoMemoryMB));
|
||||
info.videoMemoryMB = (GLint)(((uint32_t)info.videoMemoryMB + 1) >> 20);
|
||||
CGLDescribeRenderer(cglRendererInfo, i, kCGLRPTextureMemory, &(info.textureMemoryMB));
|
||||
info.textureMemoryMB = (GLint)(((uint32_t)info.textureMemoryMB + 1) >> 20);
|
||||
|
||||
if (isLionSupported)
|
||||
{
|
||||
CGLDescribeRenderer(cglRendererInfo, i, kCGLRPVideoMemoryMegabytes, &(info.videoMemoryMB));
|
||||
CGLDescribeRenderer(cglRendererInfo, i, kCGLRPTextureMemoryMegabytes, &(info.textureMemoryMB));
|
||||
}
|
||||
else
|
||||
{
|
||||
CGLDescribeRenderer(cglRendererInfo, i, kCGLRPVideoMemory, &(info.videoMemoryMB));
|
||||
info.videoMemoryMB = (GLint)(((uint32_t)info.videoMemoryMB + 1) >> 20);
|
||||
CGLDescribeRenderer(cglRendererInfo, i, kCGLRPTextureMemory, &(info.textureMemoryMB));
|
||||
info.textureMemoryMB = (GLint)(((uint32_t)info.textureMemoryMB + 1) >> 20);
|
||||
}
|
||||
|
||||
if (isHighSierraSupported)
|
||||
{
|
||||
CGLDescribeRenderer(cglRendererInfo, i, kCGLRPRemovable, &(info.removable));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -2040,65 +2142,115 @@ static bool __cgl_initOpenGL(const int requestedProfile)
|
|||
|
||||
for (int j = 0; j < rendererCount; j++)
|
||||
{
|
||||
GLRendererInfo &info = rendererInfo[j];
|
||||
HostRendererInfo &info = rendererInfo[j];
|
||||
|
||||
if (r == info.rendererID)
|
||||
{
|
||||
info.virtualScreen = i;
|
||||
info.vendorStr = glGetString(GL_VENDOR);
|
||||
info.rendererStr = glGetString(GL_RENDERER);
|
||||
|
||||
info.vendorStr = (const char *)glGetString(GL_VENDOR);
|
||||
if (info.vendorStr != NULL)
|
||||
{
|
||||
strncpy(info.vendor, (const char *)info.vendorStr, sizeof(info.vendor));
|
||||
}
|
||||
else if (info.accelerated == 0)
|
||||
{
|
||||
strncpy(info.vendor, "Apple Inc.", sizeof(info.vendor));
|
||||
}
|
||||
else
|
||||
{
|
||||
strncpy(info.vendor, "UNKNOWN", sizeof(info.vendor));
|
||||
}
|
||||
|
||||
info.nameStr = (const char *)glGetString(GL_RENDERER);
|
||||
if (info.nameStr != NULL)
|
||||
{
|
||||
strncpy(info.name, (const char *)info.nameStr, sizeof(info.name));
|
||||
}
|
||||
else if (info.accelerated == 0)
|
||||
{
|
||||
strncpy(info.name, "Apple Software Renderer", sizeof(info.name));
|
||||
}
|
||||
else
|
||||
{
|
||||
strncpy(info.name, "UNKNOWN", sizeof(info.name));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cgl_endOpenGL();
|
||||
|
||||
// Get the default virtual screen.
|
||||
strncpy(__hostRendererString, "UNKNOWN", sizeof(__hostRendererString));
|
||||
__hostRendererID = -1;
|
||||
|
||||
HostRendererInfo defaultRendererInfo = rendererInfo[0];
|
||||
for (int i = 0; i < rendererCount; i++)
|
||||
{
|
||||
if (defaultVirtualScreen == rendererInfo[i].virtualScreen)
|
||||
{
|
||||
defaultRendererInfo = rendererInfo[i];
|
||||
__hostRendererID = defaultRendererInfo.rendererID;
|
||||
strncpy(__hostRendererString, (const char *)defaultRendererInfo.name, sizeof(__hostRendererString));
|
||||
|
||||
if ( (defaultRendererInfo.online == 1) && (defaultRendererInfo.vendorStr != NULL) && (defaultRendererInfo.nameStr != NULL) )
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
printf("Default OpenGL Renderer: [0x%08X] %s\n", __hostRendererID, __hostRendererString);
|
||||
/*
|
||||
bool isDefaultRunningIntegratedGPU = false;
|
||||
if ( (defaultRendererInfo.online == 1) && (defaultRendererInfo.vendorStr != NULL) && (defaultRendererInfo.nameStr != NULL) )
|
||||
{
|
||||
const HostRendererInfo &d = defaultRendererInfo;
|
||||
isDefaultRunningIntegratedGPU = (strstr(d.name, "GMA 950") != NULL) ||
|
||||
(strstr(d.name, "GMA X3100") != NULL) ||
|
||||
(strstr(d.name, "GeForce 9400M") != NULL) ||
|
||||
(strstr(d.name, "GeForce 320M") != NULL) ||
|
||||
(strstr(d.name, "HD Graphics") != NULL) ||
|
||||
(strstr(d.name, "Iris 5100") != NULL) ||
|
||||
(strstr(d.name, "Iris Plus") != NULL) ||
|
||||
(strstr(d.name, "Iris Pro") != NULL) ||
|
||||
(strstr(d.name, "Iris Graphics") != NULL) ||
|
||||
(strstr(d.name, "UHD Graphics") != NULL);
|
||||
}
|
||||
*/
|
||||
#if defined(DEBUG) && (DEBUG == 1)
|
||||
// Report information on every renderer.
|
||||
if (!IsOSXVersionSupported(10, 7, 0))
|
||||
if (!isLionSupported)
|
||||
{
|
||||
printf("WARNING: You are running a macOS version earlier than v10.7.\n Video Memory and Texture Memory reporting is capped\n at 2048 MB on older macOS.\n");
|
||||
}
|
||||
printf("No. renderers: %i\n", rendererCount);
|
||||
printf(" No. virtual screens: %i\n\n", virtualScreenCount);
|
||||
printf("CGL Renderer Count: %i\n", rendererCount);
|
||||
printf(" Virtual Screen Count: %i\n\n", virtualScreenCount);
|
||||
|
||||
for (int i = 0; i < rendererCount; i++)
|
||||
{
|
||||
const GLRendererInfo &info = rendererInfo[i];
|
||||
const HostRendererInfo &info = rendererInfo[i];
|
||||
|
||||
printf("Renderer Index: %i\n", i);
|
||||
printf("Virtual Screen: %i\n", info.virtualScreen);
|
||||
|
||||
if (info.vendorStr != NULL)
|
||||
{
|
||||
printf("Vendor: %s\n", info.vendorStr);
|
||||
}
|
||||
else if (info.accelerated == 0)
|
||||
{
|
||||
printf("Vendor: Apple\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Vendor: UNKNOWN\n");
|
||||
}
|
||||
|
||||
if (info.rendererStr != NULL)
|
||||
{
|
||||
printf("Renderer: %s\n", info.rendererStr);
|
||||
}
|
||||
else if (info.accelerated == 0)
|
||||
{
|
||||
printf("Renderer: Apple Software Renderer\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Renderer: UNKNOWN\n");
|
||||
}
|
||||
|
||||
printf("Renderer ID: %i\n", info.rendererID);
|
||||
printf("Vendor: %s\n", info.vendor);
|
||||
printf("Renderer: %s\n", info.name);
|
||||
printf("Renderer ID: 0x%08X\n", info.rendererID);
|
||||
printf("Accelerated: %s\n", (info.accelerated == 1) ? "YES" : "NO");
|
||||
printf("Online: %s\n", (info.online == 1) ? "YES" : "NO");
|
||||
printf("Display ID: %i\n", info.displayID);
|
||||
|
||||
if (isHighSierraSupported)
|
||||
{
|
||||
printf("Removable: %s\n", (info.removable == 1) ? "YES" : "NO");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Removable: UNSUPPORTED, Requires High Sierra\n");
|
||||
}
|
||||
|
||||
printf("Display ID: 0x%08X\n", info.displayID);
|
||||
printf("Video Memory: %i MB\n", info.videoMemoryMB);
|
||||
printf("Texture Memory: %i MB\n\n", info.textureMemoryMB);
|
||||
}
|
||||
|
@ -2106,30 +2258,66 @@ static bool __cgl_initOpenGL(const int requestedProfile)
|
|||
|
||||
// Search for a better virtual screen that will suit our offscreen rendering better.
|
||||
//
|
||||
// At the moment, we're only supporting the second GPU on the 2013 Mac Pro since it
|
||||
// is guaranteed to never have a display associated with it. Attempting to support
|
||||
// any offline renderer would require a lot more code to handle dynamically changing
|
||||
// display<-->renderer associations. - rogerman 2025/03/17
|
||||
// At the moment, we are not supporting removable renderers such as eGPUs. Attempting
|
||||
// to support removable renderers would require a lot more code to handle dynamically
|
||||
// changing display<-->renderer associations. - rogerman 2025/03/25
|
||||
bool wasBetterVirtualScreenFound = false;
|
||||
|
||||
char *modelCString = NULL;
|
||||
size_t modelStringLen = 0;
|
||||
|
||||
sysctlbyname("hw.model", NULL, &modelStringLen, NULL, 0);
|
||||
if (modelStringLen > 0)
|
||||
{
|
||||
modelCString = (char *)malloc(modelStringLen * sizeof(char));
|
||||
sysctlbyname("hw.model", modelCString, &modelStringLen, NULL, 0);
|
||||
}
|
||||
|
||||
for (int i = 0; i < rendererCount; i++)
|
||||
{
|
||||
const GLRendererInfo &info = rendererInfo[i];
|
||||
const HostRendererInfo &info = rendererInfo[i];
|
||||
|
||||
if ( (info.vendorStr == NULL) || (info.rendererStr == NULL) )
|
||||
if ( (defaultRendererInfo.vendorStr == NULL) || (defaultRendererInfo.nameStr == NULL) || (info.vendorStr == NULL) || (info.nameStr == NULL) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( (info.accelerated == 1) &&
|
||||
(info.online == 0) &&
|
||||
(strstr((const char *)info.vendorStr, "ATI Technologies Inc.") != NULL) &&
|
||||
((strstr((const char *)info.rendererStr, "FirePro D300") != NULL) ||
|
||||
(strstr((const char *)info.rendererStr, "FirePro D500") != NULL) ||
|
||||
(strstr((const char *)info.rendererStr, "FirePro D700") != NULL)) )
|
||||
wasBetterVirtualScreenFound = (info.accelerated == 1) &&
|
||||
( ( (modelCString != NULL) && (strstr((const char *)modelCString, "MacBookPro") != NULL) &&
|
||||
( ( (strstr(defaultRendererInfo.name, "GeForce 9400M") != NULL) &&
|
||||
(strstr(info.name, "GeForce 9600M GT") != NULL) ) ||
|
||||
( (strstr(defaultRendererInfo.name, "HD Graphics") != NULL) &&
|
||||
((strstr(info.name, "GeForce GT 330M") != NULL) ||
|
||||
(strstr(info.name, "Radeon HD 6490M") != NULL) ||
|
||||
(strstr(info.name, "Radeon HD 6750M") != NULL) ||
|
||||
(strstr(info.name, "Radeon HD 6770M") != NULL) ||
|
||||
(strstr(info.name, "GeForce GT 650M") != NULL) ||
|
||||
(strstr(info.name, "Radeon Pro 450") != NULL) ||
|
||||
(strstr(info.name, "Radeon Pro 455") != NULL) ||
|
||||
(strstr(info.name, "Radeon Pro 555") != NULL) ||
|
||||
(strstr(info.name, "Radeon Pro 560") != NULL)) ) ||
|
||||
( (strstr(defaultRendererInfo.name, "Iris Pro") != NULL) &&
|
||||
((strstr(info.name, "GeForce GT 750M") != NULL) ||
|
||||
(strstr(info.name, "Radeon R9 M370X") != NULL)) ) ||
|
||||
( (strstr(defaultRendererInfo.name, "UHD Graphics") != NULL) &&
|
||||
((strstr(info.name, "Radeon Pro 555X") != NULL) ||
|
||||
(strstr(info.name, "Radeon Pro 560X") != NULL) ||
|
||||
(strstr(info.name, "Radeon Pro Vega 16") != NULL) ||
|
||||
(strstr(info.name, "Radeon Pro Vega 20") != NULL) ||
|
||||
(strstr(info.name, "Radeon Pro 5300M") != NULL) ||
|
||||
(strstr(info.name, "Radeon Pro 5500M") != NULL) ||
|
||||
(strstr(info.name, "Radeon Pro 5600M") != NULL)) ) ) ) ||
|
||||
( (modelCString != NULL) && (strstr((const char *)modelCString, "MacPro6,1") != NULL) && (info.online == 0) &&
|
||||
((strstr(info.name, "FirePro D300") != NULL) ||
|
||||
(strstr(info.name, "FirePro D500") != NULL) ||
|
||||
(strstr(info.name, "FirePro D700") != NULL)) ) );
|
||||
|
||||
if (wasBetterVirtualScreenFound)
|
||||
{
|
||||
CGLSetVirtualScreen(newContext, info.virtualScreen);
|
||||
printf("Selected Renderer: %i | %s\n", info.rendererID, info.rendererStr);
|
||||
wasBetterVirtualScreenFound = true;
|
||||
__hostRendererID = info.rendererID;
|
||||
strncpy(__hostRendererString, (const char *)info.name, sizeof(__hostRendererString));
|
||||
printf("Found Better OpenGL Renderer: [0x%08X] %s\n", __hostRendererID, __hostRendererString);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -2138,21 +2326,12 @@ static bool __cgl_initOpenGL(const int requestedProfile)
|
|||
if (!wasBetterVirtualScreenFound)
|
||||
{
|
||||
CGLSetVirtualScreen(newContext, defaultVirtualScreen);
|
||||
|
||||
for (int i = 0; i < rendererCount; i++)
|
||||
{
|
||||
GLRendererInfo &info = rendererInfo[i];
|
||||
|
||||
if ( (defaultVirtualScreen == info.virtualScreen) && (info.accelerated == 1) )
|
||||
{
|
||||
printf("Selected Renderer: %i | %s\n", info.rendererID, info.rendererStr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// We're done! Report success and return.
|
||||
printf("%s: OpenGL context creation successful.\n", ctxString);
|
||||
printf("%s: OpenGL context creation successful.\n\n", ctxString);
|
||||
free(rendererInfo);
|
||||
free(modelCString);
|
||||
|
||||
result = true;
|
||||
return result;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright (C) 2017-2024 DeSmuME team
|
||||
Copyright (C) 2017-2025 DeSmuME team
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -20,6 +20,11 @@
|
|||
#endif
|
||||
|
||||
#include "MacMetalDisplayView.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include <IOKit/graphics/IOGraphicsLib.h>
|
||||
|
||||
#include "../cocoa_globals.h"
|
||||
|
||||
#include "../../../common.h"
|
||||
|
@ -54,13 +59,118 @@
|
|||
|
||||
- (id)init
|
||||
{
|
||||
device = nil;
|
||||
|
||||
self = [super init];
|
||||
if (self == nil)
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
device = MTLCreateSystemDefaultDevice();
|
||||
#if defined(DEBUG) && (DEBUG == 1)
|
||||
// Report information on every renderer.
|
||||
NSArray< id<MTLDevice> > *mtlDeviceList = MTLCopyAllDevices();
|
||||
int rendererCount = (int)[mtlDeviceList count];
|
||||
printf("Metal Renderer Count: %i\n\n", rendererCount);
|
||||
|
||||
for (int i = 0; i < rendererCount; i++)
|
||||
{
|
||||
id<MTLDevice> mtlDevice = [mtlDeviceList objectAtIndex:i];
|
||||
|
||||
printf("Renderer Index: %i\n", i);
|
||||
printf("Renderer: %s\n", [[mtlDevice name] cStringUsingEncoding:NSUTF8StringEncoding]);
|
||||
|
||||
#if HAVE_OSAVAILABLE && defined(MAC_OS_X_VERSION_10_13) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_13)
|
||||
if (@available(macOS 10.13, *))
|
||||
{
|
||||
printf("Renderer ID: 0x%08llX\n", [mtlDevice registryID]);
|
||||
printf("Removable: %s\n", [mtlDevice isRemovable] ? "YES" : "NO");
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
printf("Renderer ID: UNSUPPORTED, Requires High Sierra\n");
|
||||
printf("Removable: UNSUPPORTED, Requires High Sierra\n");
|
||||
}
|
||||
|
||||
printf("Online: %s\n\n", [mtlDevice isHeadless] ? "NO" : "YES");
|
||||
}
|
||||
#endif
|
||||
|
||||
// Check if we're running on a MacBook Pro. If we are, then set our rendering device
|
||||
// to whatever the built-in display is using in order to respect the user setting for
|
||||
// Automatic Graphics Switching.
|
||||
char *modelCString = NULL;
|
||||
size_t modelStringLen = 0;
|
||||
|
||||
sysctlbyname("hw.model", NULL, &modelStringLen, NULL, 0);
|
||||
if (modelStringLen > 0)
|
||||
{
|
||||
modelCString = (char *)malloc(modelStringLen * sizeof(char));
|
||||
sysctlbyname("hw.model", modelCString, &modelStringLen, NULL, 0);
|
||||
}
|
||||
|
||||
if (strstr(modelCString, "MacBookPro") != NULL)
|
||||
{
|
||||
bool isBuiltInDisplayFound = false;
|
||||
NSArray<NSScreen *> *screenList = [NSScreen screens];
|
||||
for (NSScreen *theScreen in screenList)
|
||||
{
|
||||
NSNumber *screenNumber = (NSNumber *)[[theScreen deviceDescription] objectForKey:@"NSScreenNumber"];
|
||||
CGDirectDisplayID displayID = [screenNumber unsignedIntValue];
|
||||
|
||||
isBuiltInDisplayFound = CGDisplayIsBuiltin(displayID);
|
||||
if (isBuiltInDisplayFound)
|
||||
{
|
||||
// If we're running on a MacBook Pro with dual GPUs, we need to set our rendering device to
|
||||
// whatever the built-in display is running. This has a chance of choosing the integrated GPU,
|
||||
// but only under the following conditions:
|
||||
// - The user has Automatic Graphics Switching enabled in System Preferences
|
||||
// - The MacBook Pro's built-in display is online and available (in other words, the
|
||||
// MacBook Pro's lid is open, not closed)
|
||||
// - There are no additional displays connected to the MacBook Pro
|
||||
// - The app has "Prefer External GPU" unchecked in Finder Get Info
|
||||
device = CGDirectDisplayCopyCurrentMetalDevice(displayID);
|
||||
NSString *screenName = NULL;
|
||||
|
||||
// For debugging purposes, let's also report the name of the display that the rendering device
|
||||
// is associated to.
|
||||
#if HAVE_OSAVAILABLE && defined(MAC_OS_X_VERSION_10_15) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_15)
|
||||
if (@available(macOS 10.15, *))
|
||||
{
|
||||
screenName = [theScreen localizedName];
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
io_connect_t displayPort = SILENCE_DEPRECATION_MACOS_10_9( CGDisplayIOServicePort(displayID) );
|
||||
NSDictionary *screenInfo = CFBridgingRelease( IODisplayCreateInfoDictionary(displayPort, kIODisplayOnlyPreferredName) );
|
||||
NSDictionary *localizedNames = (NSDictionary *)[screenInfo objectForKey:[NSString stringWithUTF8String:kDisplayProductName]];
|
||||
if ([localizedNames count] > 0)
|
||||
{
|
||||
screenName = (NSString *)[localizedNames objectForKey:[[localizedNames allKeys] objectAtIndex:0]];
|
||||
}
|
||||
}
|
||||
|
||||
printf("MacBook Pro Built-in Display: %s\n", [screenName cStringUsingEncoding:NSUTF8StringEncoding]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (modelStringLen > 0)
|
||||
{
|
||||
free(modelCString);
|
||||
modelCString = NULL;
|
||||
}
|
||||
|
||||
// If no rendering device was set from beforehand, then just use the system default renderer.
|
||||
// For MacBook Pro with dual GPUs, this will NEVER choose the integrated GPU.
|
||||
if (device == nil)
|
||||
{
|
||||
device = MTLCreateSystemDefaultDevice();
|
||||
}
|
||||
|
||||
if (device == nil)
|
||||
{
|
||||
NSLog(@"Metal: A Metal device could not be found.");
|
||||
|
@ -77,6 +187,7 @@
|
|||
}
|
||||
|
||||
[device retain];
|
||||
printf("Selected Metal Renderer: %s\n\n\n", [[device name] cStringUsingEncoding:NSUTF8StringEncoding]);
|
||||
|
||||
NSString *tempVersionStr = @"Metal - Unknown GPU Family";
|
||||
const BOOL isRWTexSupported = [device supportsFeatureSet:(MTLFeatureSet)10002]; // MTLFeatureSet_macOS_ReadWriteTextureTier2
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright (C) 2017-2022 DeSmuME team
|
||||
Copyright (C) 2017-2025 DeSmuME team
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -142,6 +142,14 @@ MacOGLClientFetchObject::MacOGLClientFetchObject()
|
|||
(NSOpenGLPixelFormatAttribute)0
|
||||
};
|
||||
|
||||
// Normally, supporting Automatic Graphics Switching and allowing the context
|
||||
// to use the integrated GPU requires NSOpenGLPFAAllowOfflineRenderers in the
|
||||
// pixel format attributes. However, GPUs that can't support Metal are also
|
||||
// too slow to run most of the video filters on OpenGL, and also show poor
|
||||
// performance when running multiple display windows with high GPU scaling
|
||||
// factors. Therefore, we will NOT allow OpenGL to run contexts on the
|
||||
// integrated GPU for performance reasons. -rogerman (2025/03/26)
|
||||
|
||||
#ifdef _OGLDISPLAYOUTPUT_3_2_H_
|
||||
// If we can support a 3.2 Core Profile context, then request that in our
|
||||
// pixel format attributes.
|
||||
|
@ -335,6 +343,14 @@ void MacOGLDisplayPresenter::__InstanceInit(MacOGLClientFetchObject *fetchObject
|
|||
(NSOpenGLPixelFormatAttribute)0
|
||||
};
|
||||
|
||||
// Normally, supporting Automatic Graphics Switching and allowing the context
|
||||
// to use the integrated GPU requires NSOpenGLPFAAllowOfflineRenderers in the
|
||||
// pixel format attributes. However, GPUs that can't support Metal are also
|
||||
// too slow to run most of the video filters on OpenGL, and also show poor
|
||||
// performance when running multiple display windows with high GPU scaling
|
||||
// factors. Therefore, we will NOT allow OpenGL to run contexts on the
|
||||
// integrated GPU for performance reasons. -rogerman (2025/03/26)
|
||||
|
||||
#ifdef _OGLDISPLAYOUTPUT_3_2_H_
|
||||
// If we can support a 3.2 Core Profile context, then request that in our
|
||||
// pixel format attributes.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Copyright (C) 2011 Roger Manuel
|
||||
Copyright (C) 2012-2023 DeSmuME Team
|
||||
Copyright (C) 2012-2025 DeSmuME Team
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -68,6 +68,7 @@
|
|||
NSOpenGLPFADepthSize, (NSOpenGLPixelFormatAttribute)0,
|
||||
NSOpenGLPFAStencilSize, (NSOpenGLPixelFormatAttribute)0,
|
||||
(NSOpenGLPixelFormatAttribute)0, (NSOpenGLPixelFormatAttribute)0,
|
||||
(NSOpenGLPixelFormatAttribute)NSOpenGLPFAAllowOfflineRenderers,
|
||||
(NSOpenGLPixelFormatAttribute)0 };
|
||||
|
||||
#ifdef _OGLDISPLAYOUTPUT_3_2_H_
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright (C) 2012-2023 DeSmuME team
|
||||
Copyright (C) 2012-2025 DeSmuME team
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -18,6 +18,8 @@
|
|||
#import "troubleshootingWindowDelegate.h"
|
||||
#import "EmuControllerDelegate.h"
|
||||
|
||||
#include "../../../render3D.h"
|
||||
|
||||
#import "cocoa_util.h"
|
||||
#import "cocoa_globals.h"
|
||||
#import "cocoa_cheat.h"
|
||||
|
@ -109,24 +111,31 @@
|
|||
finalFormTextStr = [[finalFormTextStr stringByAppendingString:@"\nGPU - Scaling Factor: "] stringByAppendingString:[NSString stringWithFormat:@"%ldx", (unsigned long)[[cdsCore cdsGPU] gpuScale]]];
|
||||
finalFormTextStr = [[finalFormTextStr stringByAppendingString:@"\nGPU - Color Depth: "] stringByAppendingString:[NSString stringWithFormat:@"%@", ([[cdsCore cdsGPU] gpuColorFormat] == NDSColorFormat_BGR555_Rev) ? @"15-bit" : (([[cdsCore cdsGPU] gpuColorFormat] == NDSColorFormat_BGR666_Rev) ? @"18-bit" : @"24-bit")]];
|
||||
|
||||
NSString *render3DEngineDetails = [[cdsCore cdsGPU] render3DRenderingEngineString];
|
||||
switch ([[cdsCore cdsGPU] render3DRenderingEngine])
|
||||
NSString *render3DEngineDetails = [[cdsCore cdsGPU] render3DRenderingEngineAppliedHostRendererName];
|
||||
switch ([[cdsCore cdsGPU] render3DRenderingEngineApplied])
|
||||
{
|
||||
case CORE3DLIST_NULL:
|
||||
case RENDERID_NULL:
|
||||
break;
|
||||
|
||||
case CORE3DLIST_SWRASTERIZE:
|
||||
case RENDERID_SOFTRASTERIZER:
|
||||
render3DEngineDetails = [NSString stringWithFormat:@"%@ (HighResColor=%@, LineHack=%@, FragmentSamplingHack=%@, ThreadCount=%@)",
|
||||
[[cdsCore cdsGPU] render3DRenderingEngineString],
|
||||
[[cdsCore cdsGPU] render3DRenderingEngineAppliedHostRendererName],
|
||||
([[cdsCore cdsGPU] render3DHighPrecisionColorInterpolation] ? @"YES" : @"NO"),
|
||||
([[cdsCore cdsGPU] render3DLineHack] ? @"YES" : @"NO"),
|
||||
([[cdsCore cdsGPU] render3DFragmentSamplingHack] ? @"YES" : @"NO"),
|
||||
([[cdsCore cdsGPU] render3DThreads] == 0 ? @"Automatic" : [NSString stringWithFormat:@"%ld", (unsigned long)[[cdsCore cdsGPU] render3DThreads]])];
|
||||
break;
|
||||
|
||||
case CORE3DLIST_OPENGL:
|
||||
render3DEngineDetails = [NSString stringWithFormat:@"%@ (MSAA=%@, SmoothTextures=%@)",
|
||||
[[cdsCore cdsGPU] render3DRenderingEngineString],
|
||||
case RENDERID_OPENGL_AUTO:
|
||||
case RENDERID_OPENGL_LEGACY:
|
||||
case RENDERID_OPENGL_3_2:
|
||||
render3DEngineDetails = [NSString stringWithFormat:@"%@ [0x%08lX] (EnableShadowPolygons=%@, EnableZeroAlphaBlending=%@, EnableNDSDepthCalculation=%@, EnableDepthLEqualPolygonFacing=%@, MSAA=%@, SmoothTextures=%@)",
|
||||
[[cdsCore cdsGPU] render3DRenderingEngineAppliedHostRendererName],
|
||||
[[cdsCore cdsGPU] render3DRenderingEngineAppliedHostRendererID],
|
||||
[[cdsCore cdsGPU] openGLEmulateShadowPolygon] ? @"YES" : @"NO",
|
||||
[[cdsCore cdsGPU] openGLEmulateSpecialZeroAlphaBlending] ? @"YES" : @"NO",
|
||||
[[cdsCore cdsGPU] openGLEmulateNDSDepthCalculation] ? @"YES" : @"NO",
|
||||
[[cdsCore cdsGPU] openGLEmulateDepthLEqualPolygonFacing] ? @"YES" : @"NO",
|
||||
([[cdsCore cdsGPU] render3DMultisampleSize] == 0) ? @"Off" : [NSString stringWithFormat:@"%ld", (unsigned long)[[cdsCore cdsGPU] render3DMultisampleSize]],
|
||||
[[cdsCore cdsGPU] render3DTextureSmoothing] ? @"YES" : @"NO"];
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue