⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 269118 in webkit


Ignore:
Timestamp:
Oct 28, 2020, 1:26:13 PM (6 years ago)
Author:
timothy_horton@apple.com
Message:

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.

Location:
trunk/Source
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/ThirdParty/ANGLE/ChangeLog

    r268420 r269118  
     12020-10-28  Tim Horton  <timothy_horton@apple.com>
     2
     3        macCatalyst WebGL on Apple Silicon devices is using a software renderer
     4        https://bugs.webkit.org/show_bug.cgi?id=218303
     5        <rdar://problem/70587571>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        * src/gpu_info_util/SystemInfo.h:
     10        * src/gpu_info_util/SystemInfo_apple.mm:
     11        (angle::GetSystemInfo):
     12        We can just use the macOS version of GetSystemInfo in macCatalyst.
     13
     14        * src/gpu_info_util/SystemInfo_macos.mm:
     15        (angle::GetSystemInfo_mac):
     16        * src/libANGLE/Display.cpp:
     17        * src/libANGLE/formatutils.cpp:
     18        (gl::BuildInternalFormatInfoMap):
     19        * src/libANGLE/renderer/gl/renderergl_utils.cpp:
     20        (rx::nativegl_gl::GenerateCaps):
     21        It turns out we must use EAGL in macCatalyst on Apple Silicon in all cases,
     22        not just in-process in iOS apps (the problem is not just about coexistence
     23        of the two GLs, but actually about our ability to load the accelerated
     24        renderer /at all/ in macCatalyst processes).
     25
     26        I left the runtime switching in place, because there is a future in which
     27        we /can/ use CGL in non-iOS-app processes, but that future is not now.
     28
    1292020-10-13  Keith Rollin  <krollin@apple.com>
    230
  • trunk/Source/ThirdParty/ANGLE/src/gpu_info_util/SystemInfo.h

    r267602 r269118  
    6868    // Only true on dual-GPU Mac laptops.
    6969    bool isMacSwitchable = false;
    70     // Only true on Apple Silicon Macs when running iOS binaries.
    71     // See https://developer.apple.com/documentation/foundation/nsprocessinfo/3608556-iosapponmac
    72     bool isiOSAppOnMac   = false;
     70    // Only true on Apple Silicon Macs when running in macCatalyst.
     71    bool needsEAGLOnMac   = false;
    7372
    7473    // Only available on Android
  • trunk/Source/ThirdParty/ANGLE/src/gpu_info_util/SystemInfo_apple.mm

    r267602 r269118  
    2020bool GetSystemInfo(SystemInfo *info)
    2121{
    22 #if defined(ANGLE_PLATFORM_MACCATALYST) && defined(ANGLE_CPU_ARM64)
    23     static bool isiOSAppOnMac = false;
    24     static dispatch_once_t once;
    25     dispatch_once(&once, ^{
    26         isiOSAppOnMac = [[NSProcessInfo processInfo] isiOSAppOnMac];
    27     });
    28 
    29     if (isiOSAppOnMac)
    30     {
    31         GetSystemInfo_ios(info);
    32         if (info)
    33         {
    34             info->isiOSAppOnMac = true;
    35         }
    36         return info;
    37     }
    38 
    39     return GetSystemInfo_mac(info);
    40 #elif defined(ANGLE_PLATFORM_MACOS) || defined(ANGLE_PLATFORM_MACCATALYST)
     22#if defined(ANGLE_PLATFORM_MACOS) || defined(ANGLE_PLATFORM_MACCATALYST)
    4123    return GetSystemInfo_mac(info);
    4224#else
  • trunk/Source/ThirdParty/ANGLE/src/gpu_info_util/SystemInfo_macos.mm

    r267602 r269118  
    248248        info->isMacSwitchable = true;
    249249    }
     250   
     251#if defined(ANGLE_PLATFORM_MACCATALYST) && defined(ANGLE_CPU_ARM64)
     252    info->needsEAGLOnMac = true;
     253#endif
    250254
    251255    return true;
  • trunk/Source/ThirdParty/ANGLE/src/libANGLE/Display.cpp

    r267869 r269118  
    280280                }
    281281
    282                 if (info.isiOSAppOnMac)
     282                if (info.needsEAGLOnMac)
    283283                {
    284284                    impl = new rx::DisplayEAGL(state);
  • trunk/Source/ThirdParty/ANGLE/src/libANGLE/formatutils.cpp

    r267602 r269118  
    10361036    if (angle::GetSystemInfo(&info))
    10371037    {
    1038         if (info.isiOSAppOnMac)
     1038        if (info.needsEAGLOnMac)
    10391039        {
    10401040            // Using OpenGLES.framework.
  • trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/renderergl_utils.cpp

    r267770 r269118  
    13601360    if (angle::GetSystemInfo(&info))
    13611361    {
    1362         if (!info.isiOSAppOnMac)
     1362        if (!info.needsEAGLOnMac)
    13631363        {
    13641364            VendorID vendor = GetVendorID(functions);
  • trunk/Source/WebCore/ChangeLog

    r269116 r269118  
     12020-10-28  Tim Horton  <timothy_horton@apple.com>
     2
     3        macCatalyst WebGL on Apple Silicon devices is using a software renderer
     4        https://bugs.webkit.org/show_bug.cgi?id=218303
     5        <rdar://problem/70587571>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
     10        (WebCore::needsEAGLOnMac):
     11        (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL):
     12        (WebCore::GraphicsContextGLOpenGL::IOSurfaceTextureTarget):
     13        (WebCore::GraphicsContextGLOpenGL::IOSurfaceTextureTargetQuery):
     14        (WebCore::GraphicsContextGLOpenGL::EGLIOSurfaceTextureTarget):
     15        (WebCore::isiOSAppOnMac): Deleted.
     16        See ANGLE ChangeLog.
     17
    1182020-10-28  Fujii Hironori  <Hironori.Fujii@sony.com>
    219
  • trunk/Source/WebCore/platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm

    r269025 r269118  
    109109
    110110#if PLATFORM(MAC) || PLATFORM(MACCATALYST)
    111 static bool isiOSAppOnMac()
     111static bool needsEAGLOnMac()
    112112{
    113113#if PLATFORM(MACCATALYST) && CPU(ARM64)
    114     static bool isiOSAppOnMac = false;
    115     static dispatch_once_t once;
    116     dispatch_once(&once, ^{
    117         isiOSAppOnMac = [[NSProcessInfo processInfo] isiOSAppOnMac];
    118     });
    119     return isiOSAppOnMac;
     114    return true;
    120115#else
    121116    return false;
     
    298293    ExtensionsGL& extensions = getExtensions();
    299294
    300     if (!isiOSAppOnMac()) {
     295    if (!needsEAGLOnMac()) {
    301296        static constexpr const char* requiredExtensions[] = {
    302297            "GL_ANGLE_texture_rectangle", // For IOSurface-backed textures.
     
    431426{
    432427#if PLATFORM(MACCATALYST)
    433     if (isiOSAppOnMac())
     428    if (needsEAGLOnMac())
    434429        return TEXTURE_2D;
    435430    return TEXTURE_RECTANGLE_ARB;
     
    444439{
    445440#if PLATFORM(MACCATALYST)
    446     if (isiOSAppOnMac())
     441    if (needsEAGLOnMac())
    447442        return TEXTURE_BINDING_2D;
    448443    return TEXTURE_BINDING_RECTANGLE_ARB;
     
    457452{
    458453#if PLATFORM(MACCATALYST)
    459     if (isiOSAppOnMac())
     454    if (needsEAGLOnMac())
    460455        return EGL_TEXTURE_2D;
    461456    return EGL_TEXTURE_RECTANGLE_ANGLE;
  • trunk/Source/WebKit/ChangeLog

    r269111 r269118  
     12020-10-28  Tim Horton  <timothy_horton@apple.com>
     2
     3        macCatalyst WebGL on Apple Silicon devices is using a software renderer
     4        https://bugs.webkit.org/show_bug.cgi?id=218303
     5        <rdar://problem/70587571>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        * UIProcess/mac/HighPerformanceGPUManager.mm:
     10        (WebKit::HighPerformanceGPUManager::addProcessRequiringHighPerformance):
     11        (WebKit::HighPerformanceGPUManager::removeProcessRequiringHighPerformance):
     12        (WebKit::HighPerformanceGPUManager::updateState):
     13        (WebKit::isiOSAppOnMac): Deleted.
     14        HighPerformanceGPUManager is PLATFORM(MAC)-only, which is not true
     15        for MACCATALYST, so delete this dead code.
     16
    1172020-10-28  Sam Weinig  <weinig@apple.com>
    218
  • trunk/Source/WebKit/UIProcess/mac/HighPerformanceGPUManager.mm

    r267602 r269118  
    3535namespace WebKit {
    3636
    37 static bool isiOSAppOnMac()
    38 {
    39 #if PLATFORM(MACCATALYST) && CPU(ARM64)
    40     static bool isiOSAppOnMac = false;
    41     static dispatch_once_t once;
    42     dispatch_once(&once, ^{
    43         isiOSAppOnMac = [[NSProcessInfo processInfo] isiOSAppOnMac];
    44     });
    45     return isiOSAppOnMac;
    46 #else
    47     return false;
    48 #endif
    49 }
    50 
    5137// FIXME: This class is using OpenGL to control the muxing of GPUs. Ultimately
    5238// we want to use Metal, but currently there isn't a way to "release" a
     
    6147void HighPerformanceGPUManager::addProcessRequiringHighPerformance(WebProcessProxy* process)
    6248{
    63     if (isiOSAppOnMac())
    64         return;
    65 
    6649    if (!WebCore::hasLowAndHighPowerGPUs())
    6750        return;
     
    7861void HighPerformanceGPUManager::removeProcessRequiringHighPerformance(WebProcessProxy* process)
    7962{
    80     if (isiOSAppOnMac())
    81         return;
    82 
    8363    if (!WebCore::hasLowAndHighPowerGPUs())
    8464        return;
     
    9575void HighPerformanceGPUManager::updateState()
    9676{
    97     if (isiOSAppOnMac())
    98         return;
    99 
    10077    if (m_processesRequiringHighPerformance.size()) {
    10178        if (!m_pixelFormatObj) {
Note: See TracChangeset for help on using the changeset viewer.