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

Changeset 291750 in webkit


Ignore:
Timestamp:
Mar 23, 2022, 10:39:12 AM (5 years ago)
Author:
Russell Epstein
Message:

Cherry-pick r291566. rdar://problem/90346629

Accessing WebGL content crashes in macOS Recovery OS
​https://bugs.webkit.org/show_bug.cgi?id=238139

Patch by Kimmo Kinnunen <​kkinnunen@apple.com> on 2022-03-21
Reviewed by Antti Koivisto.

Add a quick fix trying to circumvent a Recovery OS crash.
Parts of this will be reverted once the true source is found.

  • platform/graphics/cocoa/GraphicsContextGLCocoa.mm: (WebCore::platformSupportsMetal):

git-svn-id: ​https://svn.webkit.org/repository/webkit/trunk@291566 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-614.1.7-branch/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-614.1.7-branch/Source/WebCore/ChangeLog

    r291683 r291750  
     12022-03-23  Russell Epstein  <repstein@apple.com>
     2
     3        Cherry-pick r291566. rdar://problem/90346629
     4
     5    Accessing WebGL content crashes in macOS Recovery OS
     6    https://bugs.webkit.org/show_bug.cgi?id=238139
     7   
     8    Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2022-03-21
     9    Reviewed by Antti Koivisto.
     10   
     11    Add a quick fix trying to circumvent a Recovery OS crash.
     12    Parts of this will be reverted once the true source is found.
     13   
     14    * platform/graphics/cocoa/GraphicsContextGLCocoa.mm:
     15    (WebCore::platformSupportsMetal):
     16   
     17    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@291566 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     18
     19    2022-03-21  Kimmo Kinnunen  <kkinnunen@apple.com>
     20
     21            Accessing WebGL content crashes in macOS Recovery OS
     22            https://bugs.webkit.org/show_bug.cgi?id=238139
     23
     24            Reviewed by Antti Koivisto.
     25
     26            Add a quick fix trying to circumvent a Recovery OS crash.
     27            Parts of this will be reverted once the true source is found.
     28
     29            * platform/graphics/cocoa/GraphicsContextGLCocoa.mm:
     30            (WebCore::platformSupportsMetal):
     31
    1322022-03-22  Russell Epstein  <repstein@apple.com>
    233
  • branches/safari-614.1.7-branch/Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.mm

    r291468 r291750  
    4242#import <pal/spi/cocoa/MetalSPI.h>
    4343#import <wtf/BlockObjCExceptions.h>
     44#import <wtf/darwin/WeakLinking.h>
    4445#import <wtf/text/CString.h>
    4546
    … …  
    5758#import "ImageRotationSessionVT.h"
    5859#endif
     60
     61// Metal may not be available, for example in recovery OS.
     62WTF_WEAK_LINK_FORCE_IMPORT(MTLCreateSystemDefaultDevice);
    5963
    6064namespace WebCore {
    … …  
    97101static bool platformSupportsMetal(bool isWebGL2)
    98102{
     103    // FIXME: Figure out why WebKit runs in recovery system using -framework Metal, but seemingly cannot call into Metal.
     104    // The hunk about runnningInRecoverySystem should be removed once it is clear how WebKit can link strongly to Metal
     105    // but run without Metal.
     106    static bool runningInRecoverySystem = [] {
     107        if (getenv("__OSINSTALL_ENVIRONMENT")) {
     108            WTFLogAlways("WebGL: Running in recovery. Has access to Metal: %s", !MTLCreateSystemDefaultDevice ? "no" : "yes");
     109            return true;
     110        }
     111        return false;
     112    }();
     113    if (runningInRecoverySystem)
     114        return false;
     115
     116    if (!MTLCreateSystemDefaultDevice)
     117        return false;
     118
    99119    auto device = adoptNS(MTLCreateSystemDefaultDevice());
    100120
Note: See TracChangeset for help on using the changeset viewer.