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

Changeset 269158 in webkit


Ignore:
Timestamp:
Oct 29, 2020, 11:32:05 AM (6 years ago)
Author:
Russell Epstein
Message:

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

Location:
branches/safari-610-branch/Source
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-610-branch/Source/ThirdParty/ANGLE/ChangeLog

    r268469 r269158  
     12020-10-29  Russell Epstein  <repstein@apple.com>
     2
     3        Cherry-pick r269118. rdar://problem/70795320
     4
     5    macCatalyst WebGL on Apple Silicon devices is using a software renderer
     6    https://bugs.webkit.org/show_bug.cgi?id=218303
     7    <rdar://problem/70587571>
     8   
     9    Reviewed by Geoffrey Garen.
     10   
     11    Source/ThirdParty/ANGLE:
     12   
     13    * src/gpu_info_util/SystemInfo.h:
     14    * src/gpu_info_util/SystemInfo_apple.mm:
     15    (angle::GetSystemInfo):
     16    We can just use the macOS version of GetSystemInfo in macCatalyst.
     17   
     18    * src/gpu_info_util/SystemInfo_macos.mm:
     19    (angle::GetSystemInfo_mac):
     20    * src/libANGLE/Display.cpp:
     21    * src/libANGLE/formatutils.cpp:
     22    (gl::BuildInternalFormatInfoMap):
     23    * src/libANGLE/renderer/gl/renderergl_utils.cpp:
     24    (rx::nativegl_gl::GenerateCaps):
     25    It turns out we must use EAGL in macCatalyst on Apple Silicon in all cases,
     26    not just in-process in iOS apps (the problem is not just about coexistence
     27    of the two GLs, but actually about our ability to load the accelerated
     28    renderer /at all/ in macCatalyst processes).
     29   
     30    I left the runtime switching in place, because there is a future in which
     31    we /can/ use CGL in non-iOS-app processes, but that future is not now.
     32   
     33    Source/WebCore:
     34   
     35    * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
     36    (WebCore::needsEAGLOnMac):
     37    (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL):
     38    (WebCore::GraphicsContextGLOpenGL::IOSurfaceTextureTarget):
     39    (WebCore::GraphicsContextGLOpenGL::IOSurfaceTextureTargetQuery):
     40    (WebCore::GraphicsContextGLOpenGL::EGLIOSurfaceTextureTarget):
     41    (WebCore::isiOSAppOnMac): Deleted.
     42    See ANGLE ChangeLog.
     43   
     44    Source/WebKit:
     45   
     46    * UIProcess/mac/HighPerformanceGPUManager.mm:
     47    (WebKit::HighPerformanceGPUManager::addProcessRequiringHighPerformance):
     48    (WebKit::HighPerformanceGPUManager::removeProcessRequiringHighPerformance):
     49    (WebKit::HighPerformanceGPUManager::updateState):
     50    (WebKit::isiOSAppOnMac): Deleted.
     51    HighPerformanceGPUManager is PLATFORM(MAC)-only, which is not true
     52    for MACCATALYST, so delete this dead code.
     53   
     54    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269118 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     55
     56    2020-10-28  Tim Horton  <timothy_horton@apple.com>
     57
     58            macCatalyst WebGL on Apple Silicon devices is using a software renderer
     59            https://bugs.webkit.org/show_bug.cgi?id=218303
     60            <rdar://problem/70587571>
     61
     62            Reviewed by Geoffrey Garen.
     63
     64            * src/gpu_info_util/SystemInfo.h:
     65            * src/gpu_info_util/SystemInfo_apple.mm:
     66            (angle::GetSystemInfo):
     67            We can just use the macOS version of GetSystemInfo in macCatalyst.
     68
     69            * src/gpu_info_util/SystemInfo_macos.mm:
     70            (angle::GetSystemInfo_mac):
     71            * src/libANGLE/Display.cpp:
     72            * src/libANGLE/formatutils.cpp:
     73            (gl::BuildInternalFormatInfoMap):
     74            * src/libANGLE/renderer/gl/renderergl_utils.cpp:
     75            (rx::nativegl_gl::GenerateCaps):
     76            It turns out we must use EAGL in macCatalyst on Apple Silicon in all cases,
     77            not just in-process in iOS apps (the problem is not just about coexistence
     78            of the two GLs, but actually about our ability to load the accelerated
     79            renderer /at all/ in macCatalyst processes).
     80
     81            I left the runtime switching in place, because there is a future in which
     82            we /can/ use CGL in non-iOS-app processes, but that future is not now.
     83
    1842020-10-14  Alan Coon  <alancoon@apple.com>
    285
  • branches/safari-610-branch/Source/ThirdParty/ANGLE/src/gpu_info_util/SystemInfo.h

    r267980 r269158  
    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
  • branches/safari-610-branch/Source/ThirdParty/ANGLE/src/gpu_info_util/SystemInfo_apple.mm

    r267980 r269158  
    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
  • branches/safari-610-branch/Source/ThirdParty/ANGLE/src/gpu_info_util/SystemInfo_macos.mm

    r267980 r269158  
    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;
  • branches/safari-610-branch/Source/ThirdParty/ANGLE/src/libANGLE/Display.cpp

    r267981 r269158  
    280280                }
    281281
    282                 if (info.isiOSAppOnMac)
     282                if (info.needsEAGLOnMac)
    283283                {
    284284                    impl = new rx::DisplayEAGL(state);
  • branches/safari-610-branch/Source/ThirdParty/ANGLE/src/libANGLE/formatutils.cpp

    r267980 r269158  
    10351035    if (angle::GetSystemInfo(&info))
    10361036    {
    1037         if (info.isiOSAppOnMac)
     1037        if (info.needsEAGLOnMac)
    10381038        {
    10391039            // Using OpenGLES.framework.
  • branches/safari-610-branch/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/renderergl_utils.cpp

    r267980 r269158  
    13481348    if (angle::GetSystemInfo(&info))
    13491349    {
    1350         if (!info.isiOSAppOnMac)
     1350        if (!info.needsEAGLOnMac)
    13511351        {
    13521352            VendorID vendor = GetVendorID(functions);
  • branches/safari-610-branch/Source/WebCore/ChangeLog

    r269139 r269158  
     12020-10-29  Russell Epstein  <repstein@apple.com>
     2
     3        Cherry-pick r269118. rdar://problem/70795320
     4
     5    macCatalyst WebGL on Apple Silicon devices is using a software renderer
     6    https://bugs.webkit.org/show_bug.cgi?id=218303
     7    <rdar://problem/70587571>
     8   
     9    Reviewed by Geoffrey Garen.
     10   
     11    Source/ThirdParty/ANGLE:
     12   
     13    * src/gpu_info_util/SystemInfo.h:
     14    * src/gpu_info_util/SystemInfo_apple.mm:
     15    (angle::GetSystemInfo):
     16    We can just use the macOS version of GetSystemInfo in macCatalyst.
     17   
     18    * src/gpu_info_util/SystemInfo_macos.mm:
     19    (angle::GetSystemInfo_mac):
     20    * src/libANGLE/Display.cpp:
     21    * src/libANGLE/formatutils.cpp:
     22    (gl::BuildInternalFormatInfoMap):
     23    * src/libANGLE/renderer/gl/renderergl_utils.cpp:
     24    (rx::nativegl_gl::GenerateCaps):
     25    It turns out we must use EAGL in macCatalyst on Apple Silicon in all cases,
     26    not just in-process in iOS apps (the problem is not just about coexistence
     27    of the two GLs, but actually about our ability to load the accelerated
     28    renderer /at all/ in macCatalyst processes).
     29   
     30    I left the runtime switching in place, because there is a future in which
     31    we /can/ use CGL in non-iOS-app processes, but that future is not now.
     32   
     33    Source/WebCore:
     34   
     35    * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
     36    (WebCore::needsEAGLOnMac):
     37    (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL):
     38    (WebCore::GraphicsContextGLOpenGL::IOSurfaceTextureTarget):
     39    (WebCore::GraphicsContextGLOpenGL::IOSurfaceTextureTargetQuery):
     40    (WebCore::GraphicsContextGLOpenGL::EGLIOSurfaceTextureTarget):
     41    (WebCore::isiOSAppOnMac): Deleted.
     42    See ANGLE ChangeLog.
     43   
     44    Source/WebKit:
     45   
     46    * UIProcess/mac/HighPerformanceGPUManager.mm:
     47    (WebKit::HighPerformanceGPUManager::addProcessRequiringHighPerformance):
     48    (WebKit::HighPerformanceGPUManager::removeProcessRequiringHighPerformance):
     49    (WebKit::HighPerformanceGPUManager::updateState):
     50    (WebKit::isiOSAppOnMac): Deleted.
     51    HighPerformanceGPUManager is PLATFORM(MAC)-only, which is not true
     52    for MACCATALYST, so delete this dead code.
     53   
     54    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269118 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     55
     56    2020-10-28  Tim Horton  <timothy_horton@apple.com>
     57
     58            macCatalyst WebGL on Apple Silicon devices is using a software renderer
     59            https://bugs.webkit.org/show_bug.cgi?id=218303
     60            <rdar://problem/70587571>
     61
     62            Reviewed by Geoffrey Garen.
     63
     64            * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
     65            (WebCore::needsEAGLOnMac):
     66            (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL):
     67            (WebCore::GraphicsContextGLOpenGL::IOSurfaceTextureTarget):
     68            (WebCore::GraphicsContextGLOpenGL::IOSurfaceTextureTargetQuery):
     69            (WebCore::GraphicsContextGLOpenGL::EGLIOSurfaceTextureTarget):
     70            (WebCore::isiOSAppOnMac): Deleted.
     71            See ANGLE ChangeLog.
     72
    1732020-10-28  Russell Epstein  <repstein@apple.com>
    274
  • branches/safari-610-branch/Source/WebCore/platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm

    r267981 r269158  
    170170
    171171#if PLATFORM(MAC) || PLATFORM(MACCATALYST)
    172 static bool isiOSAppOnMac()
     172static bool needsEAGLOnMac()
    173173{
    174174#if PLATFORM(MACCATALYST) && CPU(ARM64)
    175     static bool isiOSAppOnMac = false;
    176     static dispatch_once_t once;
    177     dispatch_once(&once, ^{
    178         isiOSAppOnMac = [[NSProcessInfo processInfo] isiOSAppOnMac];
    179     });
    180     return isiOSAppOnMac;
     175    return true;
    181176#else
    182177    return false;
     
    463458    ExtensionsGL& extensions = getExtensions();
    464459
    465     if (!isiOSAppOnMac()) {
     460    if (!needsEAGLOnMac()) {
    466461        static constexpr const char* requiredExtensions[] = {
    467462            "GL_ANGLE_texture_rectangle", // For IOSurface-backed textures.
     
    696691{
    697692#if PLATFORM(MACCATALYST)
    698     if (isiOSAppOnMac())
     693    if (needsEAGLOnMac())
    699694        return TEXTURE_2D;
    700695    return TEXTURE_RECTANGLE_ARB;
     
    709704{
    710705#if PLATFORM(MACCATALYST)
    711     if (isiOSAppOnMac())
     706    if (needsEAGLOnMac())
    712707        return TEXTURE_BINDING_2D;
    713708    return TEXTURE_BINDING_RECTANGLE_ARB;
     
    722717{
    723718#if PLATFORM(MACCATALYST)
    724     if (isiOSAppOnMac())
     719    if (needsEAGLOnMac())
    725720        return 0x305F; // EGL_TEXTURE_2D
    726721    return 0x345B; // EGL_TEXTURE_RECTANGLE_ANGLE
  • branches/safari-610-branch/Source/WebKit/ChangeLog

    r269140 r269158  
     12020-10-29  Russell Epstein  <repstein@apple.com>
     2
     3        Cherry-pick r269118. rdar://problem/70795320
     4
     5    macCatalyst WebGL on Apple Silicon devices is using a software renderer
     6    https://bugs.webkit.org/show_bug.cgi?id=218303
     7    <rdar://problem/70587571>
     8   
     9    Reviewed by Geoffrey Garen.
     10   
     11    Source/ThirdParty/ANGLE:
     12   
     13    * src/gpu_info_util/SystemInfo.h:
     14    * src/gpu_info_util/SystemInfo_apple.mm:
     15    (angle::GetSystemInfo):
     16    We can just use the macOS version of GetSystemInfo in macCatalyst.
     17   
     18    * src/gpu_info_util/SystemInfo_macos.mm:
     19    (angle::GetSystemInfo_mac):
     20    * src/libANGLE/Display.cpp:
     21    * src/libANGLE/formatutils.cpp:
     22    (gl::BuildInternalFormatInfoMap):
     23    * src/libANGLE/renderer/gl/renderergl_utils.cpp:
     24    (rx::nativegl_gl::GenerateCaps):
     25    It turns out we must use EAGL in macCatalyst on Apple Silicon in all cases,
     26    not just in-process in iOS apps (the problem is not just about coexistence
     27    of the two GLs, but actually about our ability to load the accelerated
     28    renderer /at all/ in macCatalyst processes).
     29   
     30    I left the runtime switching in place, because there is a future in which
     31    we /can/ use CGL in non-iOS-app processes, but that future is not now.
     32   
     33    Source/WebCore:
     34   
     35    * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
     36    (WebCore::needsEAGLOnMac):
     37    (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL):
     38    (WebCore::GraphicsContextGLOpenGL::IOSurfaceTextureTarget):
     39    (WebCore::GraphicsContextGLOpenGL::IOSurfaceTextureTargetQuery):
     40    (WebCore::GraphicsContextGLOpenGL::EGLIOSurfaceTextureTarget):
     41    (WebCore::isiOSAppOnMac): Deleted.
     42    See ANGLE ChangeLog.
     43   
     44    Source/WebKit:
     45   
     46    * UIProcess/mac/HighPerformanceGPUManager.mm:
     47    (WebKit::HighPerformanceGPUManager::addProcessRequiringHighPerformance):
     48    (WebKit::HighPerformanceGPUManager::removeProcessRequiringHighPerformance):
     49    (WebKit::HighPerformanceGPUManager::updateState):
     50    (WebKit::isiOSAppOnMac): Deleted.
     51    HighPerformanceGPUManager is PLATFORM(MAC)-only, which is not true
     52    for MACCATALYST, so delete this dead code.
     53   
     54    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269118 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     55
     56    2020-10-28  Tim Horton  <timothy_horton@apple.com>
     57
     58            macCatalyst WebGL on Apple Silicon devices is using a software renderer
     59            https://bugs.webkit.org/show_bug.cgi?id=218303
     60            <rdar://problem/70587571>
     61
     62            Reviewed by Geoffrey Garen.
     63
     64            * UIProcess/mac/HighPerformanceGPUManager.mm:
     65            (WebKit::HighPerformanceGPUManager::addProcessRequiringHighPerformance):
     66            (WebKit::HighPerformanceGPUManager::removeProcessRequiringHighPerformance):
     67            (WebKit::HighPerformanceGPUManager::updateState):
     68            (WebKit::isiOSAppOnMac): Deleted.
     69            HighPerformanceGPUManager is PLATFORM(MAC)-only, which is not true
     70            for MACCATALYST, so delete this dead code.
     71
    1722020-10-28  Russell Epstein  <repstein@apple.com>
    273
  • branches/safari-610-branch/Source/WebKit/UIProcess/mac/HighPerformanceGPUManager.mm

    r267980 r269158  
    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.