Title: [291750] branches/safari-614.1.7-branch/Source/WebCore
- Revision
- 291750
- Author
- [email protected]
- Date
- 2022-03-23 10:39:12 -0700 (Wed, 23 Mar 2022)
Log 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 <[email protected]> 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
Modified Paths
Diff
Modified: branches/safari-614.1.7-branch/Source/WebCore/ChangeLog (291749 => 291750)
--- branches/safari-614.1.7-branch/Source/WebCore/ChangeLog 2022-03-23 17:12:07 UTC (rev 291749)
+++ branches/safari-614.1.7-branch/Source/WebCore/ChangeLog 2022-03-23 17:39:12 UTC (rev 291750)
@@ -1,3 +1,34 @@
+2022-03-23 Russell Epstein <[email protected]>
+
+ 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 <[email protected]> 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
+
+ 2022-03-21 Kimmo Kinnunen <[email protected]>
+
+ Accessing WebGL content crashes in macOS Recovery OS
+ https://bugs.webkit.org/show_bug.cgi?id=238139
+
+ 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):
+
2022-03-22 Russell Epstein <[email protected]>
Cherry-pick r291629. rdar://problem/89495774
Modified: branches/safari-614.1.7-branch/Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.mm (291749 => 291750)
--- branches/safari-614.1.7-branch/Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.mm 2022-03-23 17:12:07 UTC (rev 291749)
+++ branches/safari-614.1.7-branch/Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.mm 2022-03-23 17:39:12 UTC (rev 291750)
@@ -41,6 +41,7 @@
#import <Metal/Metal.h>
#import <pal/spi/cocoa/MetalSPI.h>
#import <wtf/BlockObjCExceptions.h>
+#import <wtf/darwin/WeakLinking.h>
#import <wtf/text/CString.h>
#if PLATFORM(IOS_FAMILY)
@@ -57,6 +58,9 @@
#import "ImageRotationSessionVT.h"
#endif
+// Metal may not be available, for example in recovery OS.
+WTF_WEAK_LINK_FORCE_IMPORT(MTLCreateSystemDefaultDevice);
+
namespace WebCore {
// In isCurrentContextPredictable() == true case this variable is accessed in single-threaded manner.
@@ -96,6 +100,22 @@
static bool platformSupportsMetal(bool isWebGL2)
{
+ // FIXME: Figure out why WebKit runs in recovery system using -framework Metal, but seemingly cannot call into Metal.
+ // The hunk about runnningInRecoverySystem should be removed once it is clear how WebKit can link strongly to Metal
+ // but run without Metal.
+ static bool runningInRecoverySystem = [] {
+ if (getenv("__OSINSTALL_ENVIRONMENT")) {
+ WTFLogAlways("WebGL: Running in recovery. Has access to Metal: %s", !MTLCreateSystemDefaultDevice ? "no" : "yes");
+ return true;
+ }
+ return false;
+ }();
+ if (runningInRecoverySystem)
+ return false;
+
+ if (!MTLCreateSystemDefaultDevice)
+ return false;
+
auto device = adoptNS(MTLCreateSystemDefaultDevice());
if (device) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes