Title: [295431] trunk/Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.mm
Revision
295431
Author
[email protected]
Date
2022-06-09 13:13:45 -0700 (Thu, 09 Jun 2022)

Log Message

Multisampling does not work on MTLGPUFamilyApple2 devices when using ANGLE Metal
https://bugs.webkit.org/show_bug.cgi?id=241456
<rdar://problem/90949957>

Patch by Kimmo Kinnunen <[email protected]> on 2022-06-09
Reviewed by Dean Jackson.

Use OpenGL ES for WebGL for devices prior to MTLGPUFamilyApple3.
WebGL2 already was running OpenGL ES for these devices for different reasons.

The multisample codepath is not implemented for Apple2 which
does not support MTLStoreActionStoreAndMultisampleResolve.

* Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.mm:
(WebCore::platformSupportsMetal):
(WebCore::GraphicsContextGLCocoa::platformInitializeContext):

Canonical link: https://commits.webkit.org/251437@main

Modified Paths

Diff

Modified: trunk/Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.mm (295430 => 295431)


--- trunk/Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.mm	2022-06-09 19:26:54 UTC (rev 295430)
+++ trunk/Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.mm	2022-06-09 20:13:45 UTC (rev 295431)
@@ -99,18 +99,15 @@
 }
 #endif
 
-static bool platformSupportsMetal(bool isWebGL2)
+static bool platformSupportsMetal()
 {
     auto device = adoptNS(MTLCreateSystemDefaultDevice());
 
     if (device) {
 #if PLATFORM(IOS_FAMILY) && !PLATFORM(IOS_FAMILY_SIMULATOR)
-        // A8 devices (iPad Mini 4, iPad Air 2) cannot use WebGL2 via Metal.
+        // A8 devices (iPad Mini 4, iPad Air 2) cannot use WebGL via Metal.
         // This check can be removed once they are no longer supported.
-        if (isWebGL2)
-            return [device supportsFamily:MTLGPUFamilyApple3];
-#else
-        UNUSED_PARAM(isWebGL2);
+        return [device supportsFamily:MTLGPUFamilyApple3];
 #endif
         return true;
     }
@@ -247,7 +244,7 @@
 {
     GraphicsContextGLAttributes attributes = contextAttributes();
     m_isForWebGL2 = attributes.webGLVersion == GraphicsContextGLWebGLVersion::WebGL2;
-    if (attributes.useMetal && !platformSupportsMetal(m_isForWebGL2)) {
+    if (attributes.useMetal && !platformSupportsMetal()) {
         attributes.useMetal = false;
         setContextAttributes(attributes);
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to