Diff
Modified: branches/safari-610-branch/Source/ThirdParty/ANGLE/ChangeLog (269157 => 269158)
--- branches/safari-610-branch/Source/ThirdParty/ANGLE/ChangeLog 2020-10-29 18:18:10 UTC (rev 269157)
+++ branches/safari-610-branch/Source/ThirdParty/ANGLE/ChangeLog 2020-10-29 18:32:05 UTC (rev 269158)
@@ -1,3 +1,86 @@
+2020-10-29 Russell Epstein <[email protected]>
+
+ Cherry-pick r269118. rdar://problem/70795320
+
+ macCatalyst WebGL on Apple Silicon devices is using a software renderer
+ https://bugs.webkit.org/show_bug.cgi?id=218303
+ <rdar://problem/70587571>
+
+ Reviewed by Geoffrey Garen.
+
+ Source/ThirdParty/ANGLE:
+
+ * src/gpu_info_util/SystemInfo.h:
+ * src/gpu_info_util/SystemInfo_apple.mm:
+ (angle::GetSystemInfo):
+ We can just use the macOS version of GetSystemInfo in macCatalyst.
+
+ * src/gpu_info_util/SystemInfo_macos.mm:
+ (angle::GetSystemInfo_mac):
+ * src/libANGLE/Display.cpp:
+ * src/libANGLE/formatutils.cpp:
+ (gl::BuildInternalFormatInfoMap):
+ * src/libANGLE/renderer/gl/renderergl_utils.cpp:
+ (rx::nativegl_gl::GenerateCaps):
+ It turns out we must use EAGL in macCatalyst on Apple Silicon in all cases,
+ not just in-process in iOS apps (the problem is not just about coexistence
+ of the two GLs, but actually about our ability to load the accelerated
+ renderer /at all/ in macCatalyst processes).
+
+ I left the runtime switching in place, because there is a future in which
+ we /can/ use CGL in non-iOS-app processes, but that future is not now.
+
+ Source/WebCore:
+
+ * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
+ (WebCore::needsEAGLOnMac):
+ (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL):
+ (WebCore::GraphicsContextGLOpenGL::IOSurfaceTextureTarget):
+ (WebCore::GraphicsContextGLOpenGL::IOSurfaceTextureTargetQuery):
+ (WebCore::GraphicsContextGLOpenGL::EGLIOSurfaceTextureTarget):
+ (WebCore::isiOSAppOnMac): Deleted.
+ See ANGLE ChangeLog.
+
+ Source/WebKit:
+
+ * UIProcess/mac/HighPerformanceGPUManager.mm:
+ (WebKit::HighPerformanceGPUManager::addProcessRequiringHighPerformance):
+ (WebKit::HighPerformanceGPUManager::removeProcessRequiringHighPerformance):
+ (WebKit::HighPerformanceGPUManager::updateState):
+ (WebKit::isiOSAppOnMac): Deleted.
+ HighPerformanceGPUManager is PLATFORM(MAC)-only, which is not true
+ for MACCATALYST, so delete this dead code.
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269118 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2020-10-28 Tim Horton <[email protected]>
+
+ macCatalyst WebGL on Apple Silicon devices is using a software renderer
+ https://bugs.webkit.org/show_bug.cgi?id=218303
+ <rdar://problem/70587571>
+
+ Reviewed by Geoffrey Garen.
+
+ * src/gpu_info_util/SystemInfo.h:
+ * src/gpu_info_util/SystemInfo_apple.mm:
+ (angle::GetSystemInfo):
+ We can just use the macOS version of GetSystemInfo in macCatalyst.
+
+ * src/gpu_info_util/SystemInfo_macos.mm:
+ (angle::GetSystemInfo_mac):
+ * src/libANGLE/Display.cpp:
+ * src/libANGLE/formatutils.cpp:
+ (gl::BuildInternalFormatInfoMap):
+ * src/libANGLE/renderer/gl/renderergl_utils.cpp:
+ (rx::nativegl_gl::GenerateCaps):
+ It turns out we must use EAGL in macCatalyst on Apple Silicon in all cases,
+ not just in-process in iOS apps (the problem is not just about coexistence
+ of the two GLs, but actually about our ability to load the accelerated
+ renderer /at all/ in macCatalyst processes).
+
+ I left the runtime switching in place, because there is a future in which
+ we /can/ use CGL in non-iOS-app processes, but that future is not now.
+
2020-10-14 Alan Coon <[email protected]>
Cherry-pick r268371. rdar://problem/70267767
Modified: branches/safari-610-branch/Source/ThirdParty/ANGLE/src/gpu_info_util/SystemInfo.h (269157 => 269158)
--- branches/safari-610-branch/Source/ThirdParty/ANGLE/src/gpu_info_util/SystemInfo.h 2020-10-29 18:18:10 UTC (rev 269157)
+++ branches/safari-610-branch/Source/ThirdParty/ANGLE/src/gpu_info_util/SystemInfo.h 2020-10-29 18:32:05 UTC (rev 269158)
@@ -67,9 +67,8 @@
bool isAMDSwitchable = false;
// Only true on dual-GPU Mac laptops.
bool isMacSwitchable = false;
- // Only true on Apple Silicon Macs when running iOS binaries.
- // See https://developer.apple.com/documentation/foundation/nsprocessinfo/3608556-iosapponmac
- bool isiOSAppOnMac = false;
+ // Only true on Apple Silicon Macs when running in macCatalyst.
+ bool needsEAGLOnMac = false;
// Only available on Android
std::string machineManufacturer;
Modified: branches/safari-610-branch/Source/ThirdParty/ANGLE/src/gpu_info_util/SystemInfo_apple.mm (269157 => 269158)
--- branches/safari-610-branch/Source/ThirdParty/ANGLE/src/gpu_info_util/SystemInfo_apple.mm 2020-10-29 18:18:10 UTC (rev 269157)
+++ branches/safari-610-branch/Source/ThirdParty/ANGLE/src/gpu_info_util/SystemInfo_apple.mm 2020-10-29 18:32:05 UTC (rev 269158)
@@ -19,26 +19,8 @@
bool GetSystemInfo(SystemInfo *info)
{
-#if defined(ANGLE_PLATFORM_MACCATALYST) && defined(ANGLE_CPU_ARM64)
- static bool isiOSAppOnMac = false;
- static dispatch_once_t once;
- dispatch_once(&once, ^{
- isiOSAppOnMac = [[NSProcessInfo processInfo] isiOSAppOnMac];
- });
-
- if (isiOSAppOnMac)
- {
- GetSystemInfo_ios(info);
- if (info)
- {
- info->isiOSAppOnMac = true;
- }
- return info;
- }
-
+#if defined(ANGLE_PLATFORM_MACOS) || defined(ANGLE_PLATFORM_MACCATALYST)
return GetSystemInfo_mac(info);
-#elif defined(ANGLE_PLATFORM_MACOS) || defined(ANGLE_PLATFORM_MACCATALYST)
- return GetSystemInfo_mac(info);
#else
return GetSystemInfo_ios(info);
#endif
Modified: branches/safari-610-branch/Source/ThirdParty/ANGLE/src/gpu_info_util/SystemInfo_macos.mm (269157 => 269158)
--- branches/safari-610-branch/Source/ThirdParty/ANGLE/src/gpu_info_util/SystemInfo_macos.mm 2020-10-29 18:18:10 UTC (rev 269157)
+++ branches/safari-610-branch/Source/ThirdParty/ANGLE/src/gpu_info_util/SystemInfo_macos.mm 2020-10-29 18:32:05 UTC (rev 269158)
@@ -247,6 +247,10 @@
{
info->isMacSwitchable = true;
}
+
+#if defined(ANGLE_PLATFORM_MACCATALYST) && defined(ANGLE_CPU_ARM64)
+ info->needsEAGLOnMac = true;
+#endif
return true;
}
Modified: branches/safari-610-branch/Source/ThirdParty/ANGLE/src/libANGLE/Display.cpp (269157 => 269158)
--- branches/safari-610-branch/Source/ThirdParty/ANGLE/src/libANGLE/Display.cpp 2020-10-29 18:18:10 UTC (rev 269157)
+++ branches/safari-610-branch/Source/ThirdParty/ANGLE/src/libANGLE/Display.cpp 2020-10-29 18:32:05 UTC (rev 269158)
@@ -279,7 +279,7 @@
break;
}
- if (info.isiOSAppOnMac)
+ if (info.needsEAGLOnMac)
{
impl = new rx::DisplayEAGL(state);
break;
Modified: branches/safari-610-branch/Source/ThirdParty/ANGLE/src/libANGLE/formatutils.cpp (269157 => 269158)
--- branches/safari-610-branch/Source/ThirdParty/ANGLE/src/libANGLE/formatutils.cpp 2020-10-29 18:18:10 UTC (rev 269157)
+++ branches/safari-610-branch/Source/ThirdParty/ANGLE/src/libANGLE/formatutils.cpp 2020-10-29 18:32:05 UTC (rev 269158)
@@ -1034,7 +1034,7 @@
angle::SystemInfo info;
if (angle::GetSystemInfo(&info))
{
- if (info.isiOSAppOnMac)
+ if (info.needsEAGLOnMac)
{
// Using OpenGLES.framework.
AddRGBAFormat(&map, GL_BGRA_EXT, false, 8, 8, 8, 8, 0, GL_BGRA_EXT, GL_UNSIGNED_BYTE, GL_UNSIGNED_NORMALIZED, false, RequireES<2, 0>, AlwaysSupported, RequireES<2, 0>, NeverSupported, NeverSupported);
Modified: branches/safari-610-branch/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/renderergl_utils.cpp (269157 => 269158)
--- branches/safari-610-branch/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/renderergl_utils.cpp 2020-10-29 18:18:10 UTC (rev 269157)
+++ branches/safari-610-branch/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/renderergl_utils.cpp 2020-10-29 18:32:05 UTC (rev 269158)
@@ -1347,7 +1347,7 @@
angle::SystemInfo info;
if (angle::GetSystemInfo(&info))
{
- if (!info.isiOSAppOnMac)
+ if (!info.needsEAGLOnMac)
{
VendorID vendor = GetVendorID(functions);
if ((IsAMD(vendor) || IsIntel(vendor)) && *maxSupportedESVersion >= gl::Version(3, 0))
Modified: branches/safari-610-branch/Source/WebCore/ChangeLog (269157 => 269158)
--- branches/safari-610-branch/Source/WebCore/ChangeLog 2020-10-29 18:18:10 UTC (rev 269157)
+++ branches/safari-610-branch/Source/WebCore/ChangeLog 2020-10-29 18:32:05 UTC (rev 269158)
@@ -1,3 +1,75 @@
+2020-10-29 Russell Epstein <[email protected]>
+
+ Cherry-pick r269118. rdar://problem/70795320
+
+ macCatalyst WebGL on Apple Silicon devices is using a software renderer
+ https://bugs.webkit.org/show_bug.cgi?id=218303
+ <rdar://problem/70587571>
+
+ Reviewed by Geoffrey Garen.
+
+ Source/ThirdParty/ANGLE:
+
+ * src/gpu_info_util/SystemInfo.h:
+ * src/gpu_info_util/SystemInfo_apple.mm:
+ (angle::GetSystemInfo):
+ We can just use the macOS version of GetSystemInfo in macCatalyst.
+
+ * src/gpu_info_util/SystemInfo_macos.mm:
+ (angle::GetSystemInfo_mac):
+ * src/libANGLE/Display.cpp:
+ * src/libANGLE/formatutils.cpp:
+ (gl::BuildInternalFormatInfoMap):
+ * src/libANGLE/renderer/gl/renderergl_utils.cpp:
+ (rx::nativegl_gl::GenerateCaps):
+ It turns out we must use EAGL in macCatalyst on Apple Silicon in all cases,
+ not just in-process in iOS apps (the problem is not just about coexistence
+ of the two GLs, but actually about our ability to load the accelerated
+ renderer /at all/ in macCatalyst processes).
+
+ I left the runtime switching in place, because there is a future in which
+ we /can/ use CGL in non-iOS-app processes, but that future is not now.
+
+ Source/WebCore:
+
+ * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
+ (WebCore::needsEAGLOnMac):
+ (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL):
+ (WebCore::GraphicsContextGLOpenGL::IOSurfaceTextureTarget):
+ (WebCore::GraphicsContextGLOpenGL::IOSurfaceTextureTargetQuery):
+ (WebCore::GraphicsContextGLOpenGL::EGLIOSurfaceTextureTarget):
+ (WebCore::isiOSAppOnMac): Deleted.
+ See ANGLE ChangeLog.
+
+ Source/WebKit:
+
+ * UIProcess/mac/HighPerformanceGPUManager.mm:
+ (WebKit::HighPerformanceGPUManager::addProcessRequiringHighPerformance):
+ (WebKit::HighPerformanceGPUManager::removeProcessRequiringHighPerformance):
+ (WebKit::HighPerformanceGPUManager::updateState):
+ (WebKit::isiOSAppOnMac): Deleted.
+ HighPerformanceGPUManager is PLATFORM(MAC)-only, which is not true
+ for MACCATALYST, so delete this dead code.
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269118 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2020-10-28 Tim Horton <[email protected]>
+
+ macCatalyst WebGL on Apple Silicon devices is using a software renderer
+ https://bugs.webkit.org/show_bug.cgi?id=218303
+ <rdar://problem/70587571>
+
+ Reviewed by Geoffrey Garen.
+
+ * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
+ (WebCore::needsEAGLOnMac):
+ (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL):
+ (WebCore::GraphicsContextGLOpenGL::IOSurfaceTextureTarget):
+ (WebCore::GraphicsContextGLOpenGL::IOSurfaceTextureTargetQuery):
+ (WebCore::GraphicsContextGLOpenGL::EGLIOSurfaceTextureTarget):
+ (WebCore::isiOSAppOnMac): Deleted.
+ See ANGLE ChangeLog.
+
2020-10-28 Russell Epstein <[email protected]>
Cherry-pick r268952. rdar://problem/70795327
Modified: branches/safari-610-branch/Source/WebCore/platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm (269157 => 269158)
--- branches/safari-610-branch/Source/WebCore/platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm 2020-10-29 18:18:10 UTC (rev 269157)
+++ branches/safari-610-branch/Source/WebCore/platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm 2020-10-29 18:32:05 UTC (rev 269158)
@@ -169,15 +169,10 @@
};
#if PLATFORM(MAC) || PLATFORM(MACCATALYST)
-static bool isiOSAppOnMac()
+static bool needsEAGLOnMac()
{
#if PLATFORM(MACCATALYST) && CPU(ARM64)
- static bool isiOSAppOnMac = false;
- static dispatch_once_t once;
- dispatch_once(&once, ^{
- isiOSAppOnMac = [[NSProcessInfo processInfo] isiOSAppOnMac];
- });
- return isiOSAppOnMac;
+ return true;
#else
return false;
#endif
@@ -462,7 +457,7 @@
#if PLATFORM(MAC) || PLATFORM(MACCATALYST)
ExtensionsGL& extensions = getExtensions();
- if (!isiOSAppOnMac()) {
+ if (!needsEAGLOnMac()) {
static constexpr const char* requiredExtensions[] = {
"GL_ANGLE_texture_rectangle", // For IOSurface-backed textures.
"GL_EXT_texture_format_BGRA8888", // For creating the EGL surface from an IOSurface.
@@ -695,7 +690,7 @@
GCGLenum GraphicsContextGL::IOSurfaceTextureTarget()
{
#if PLATFORM(MACCATALYST)
- if (isiOSAppOnMac())
+ if (needsEAGLOnMac())
return TEXTURE_2D;
return TEXTURE_RECTANGLE_ARB;
#elif PLATFORM(MAC)
@@ -708,7 +703,7 @@
GCGLenum GraphicsContextGL::IOSurfaceTextureTargetQuery()
{
#if PLATFORM(MACCATALYST)
- if (isiOSAppOnMac())
+ if (needsEAGLOnMac())
return TEXTURE_BINDING_2D;
return TEXTURE_BINDING_RECTANGLE_ARB;
#elif PLATFORM(MAC)
@@ -721,7 +716,7 @@
GCGLint GraphicsContextGL::EGLIOSurfaceTextureTarget()
{
#if PLATFORM(MACCATALYST)
- if (isiOSAppOnMac())
+ if (needsEAGLOnMac())
return 0x305F; // EGL_TEXTURE_2D
return 0x345B; // EGL_TEXTURE_RECTANGLE_ANGLE
#elif PLATFORM(MAC)
Modified: branches/safari-610-branch/Source/WebKit/ChangeLog (269157 => 269158)
--- branches/safari-610-branch/Source/WebKit/ChangeLog 2020-10-29 18:18:10 UTC (rev 269157)
+++ branches/safari-610-branch/Source/WebKit/ChangeLog 2020-10-29 18:32:05 UTC (rev 269158)
@@ -1,3 +1,74 @@
+2020-10-29 Russell Epstein <[email protected]>
+
+ Cherry-pick r269118. rdar://problem/70795320
+
+ macCatalyst WebGL on Apple Silicon devices is using a software renderer
+ https://bugs.webkit.org/show_bug.cgi?id=218303
+ <rdar://problem/70587571>
+
+ Reviewed by Geoffrey Garen.
+
+ Source/ThirdParty/ANGLE:
+
+ * src/gpu_info_util/SystemInfo.h:
+ * src/gpu_info_util/SystemInfo_apple.mm:
+ (angle::GetSystemInfo):
+ We can just use the macOS version of GetSystemInfo in macCatalyst.
+
+ * src/gpu_info_util/SystemInfo_macos.mm:
+ (angle::GetSystemInfo_mac):
+ * src/libANGLE/Display.cpp:
+ * src/libANGLE/formatutils.cpp:
+ (gl::BuildInternalFormatInfoMap):
+ * src/libANGLE/renderer/gl/renderergl_utils.cpp:
+ (rx::nativegl_gl::GenerateCaps):
+ It turns out we must use EAGL in macCatalyst on Apple Silicon in all cases,
+ not just in-process in iOS apps (the problem is not just about coexistence
+ of the two GLs, but actually about our ability to load the accelerated
+ renderer /at all/ in macCatalyst processes).
+
+ I left the runtime switching in place, because there is a future in which
+ we /can/ use CGL in non-iOS-app processes, but that future is not now.
+
+ Source/WebCore:
+
+ * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
+ (WebCore::needsEAGLOnMac):
+ (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL):
+ (WebCore::GraphicsContextGLOpenGL::IOSurfaceTextureTarget):
+ (WebCore::GraphicsContextGLOpenGL::IOSurfaceTextureTargetQuery):
+ (WebCore::GraphicsContextGLOpenGL::EGLIOSurfaceTextureTarget):
+ (WebCore::isiOSAppOnMac): Deleted.
+ See ANGLE ChangeLog.
+
+ Source/WebKit:
+
+ * UIProcess/mac/HighPerformanceGPUManager.mm:
+ (WebKit::HighPerformanceGPUManager::addProcessRequiringHighPerformance):
+ (WebKit::HighPerformanceGPUManager::removeProcessRequiringHighPerformance):
+ (WebKit::HighPerformanceGPUManager::updateState):
+ (WebKit::isiOSAppOnMac): Deleted.
+ HighPerformanceGPUManager is PLATFORM(MAC)-only, which is not true
+ for MACCATALYST, so delete this dead code.
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269118 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2020-10-28 Tim Horton <[email protected]>
+
+ macCatalyst WebGL on Apple Silicon devices is using a software renderer
+ https://bugs.webkit.org/show_bug.cgi?id=218303
+ <rdar://problem/70587571>
+
+ Reviewed by Geoffrey Garen.
+
+ * UIProcess/mac/HighPerformanceGPUManager.mm:
+ (WebKit::HighPerformanceGPUManager::addProcessRequiringHighPerformance):
+ (WebKit::HighPerformanceGPUManager::removeProcessRequiringHighPerformance):
+ (WebKit::HighPerformanceGPUManager::updateState):
+ (WebKit::isiOSAppOnMac): Deleted.
+ HighPerformanceGPUManager is PLATFORM(MAC)-only, which is not true
+ for MACCATALYST, so delete this dead code.
+
2020-10-28 Russell Epstein <[email protected]>
Cherry-pick r269094. rdar://problem/70795299
Modified: branches/safari-610-branch/Source/WebKit/UIProcess/mac/HighPerformanceGPUManager.mm (269157 => 269158)
--- branches/safari-610-branch/Source/WebKit/UIProcess/mac/HighPerformanceGPUManager.mm 2020-10-29 18:18:10 UTC (rev 269157)
+++ branches/safari-610-branch/Source/WebKit/UIProcess/mac/HighPerformanceGPUManager.mm 2020-10-29 18:32:05 UTC (rev 269158)
@@ -34,20 +34,6 @@
namespace WebKit {
-static bool isiOSAppOnMac()
-{
-#if PLATFORM(MACCATALYST) && CPU(ARM64)
- static bool isiOSAppOnMac = false;
- static dispatch_once_t once;
- dispatch_once(&once, ^{
- isiOSAppOnMac = [[NSProcessInfo processInfo] isiOSAppOnMac];
- });
- return isiOSAppOnMac;
-#else
- return false;
-#endif
-}
-
// FIXME: This class is using OpenGL to control the muxing of GPUs. Ultimately
// we want to use Metal, but currently there isn't a way to "release" a
// discrete MTLDevice, such that the process muxes back to an integrated GPU.
@@ -60,9 +46,6 @@
void HighPerformanceGPUManager::addProcessRequiringHighPerformance(WebProcessProxy* process)
{
- if (isiOSAppOnMac())
- return;
-
if (!WebCore::hasLowAndHighPowerGPUs())
return;
@@ -77,9 +60,6 @@
void HighPerformanceGPUManager::removeProcessRequiringHighPerformance(WebProcessProxy* process)
{
- if (isiOSAppOnMac())
- return;
-
if (!WebCore::hasLowAndHighPowerGPUs())
return;
@@ -94,9 +74,6 @@
void HighPerformanceGPUManager::updateState()
{
- if (isiOSAppOnMac())
- return;
-
if (m_processesRequiringHighPerformance.size()) {
if (!m_pixelFormatObj) {
LOG(WebGL, "HighPerformanceGPUManager - turning on high-performance GPU.");