Skip to content
Browse files
Multisampling does not work on MTLGPUFamilyApple2 devices when using …
…ANGLE Metal

Patch by Kimmo Kinnunen <> 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/

Canonical link:
git-svn-id: 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
kkinnunen-apple authored and webkit-commit-queue committed Jun 9, 2022
1 parent 4c12dfb commit d386d621d0d700125a00f27d897d89b4326d8171
Showing 1 changed file with 4 additions and 7 deletions.
@@ -99,18 +99,15 @@ static bool checkVolatileContextSupportIfDeviceExists(EGLDisplay display, const

static bool platformSupportsMetal(bool isWebGL2)
static bool platformSupportsMetal()
auto device = adoptNS(MTLCreateSystemDefaultDevice());

if (device) {
// 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];
return [device supportsFamily:MTLGPUFamilyApple3];
return true;
@@ -247,7 +244,7 @@ static bool needsEAGLOnMac()
GraphicsContextGLAttributes attributes = contextAttributes();
m_isForWebGL2 = attributes.webGLVersion == GraphicsContextGLWebGLVersion::WebGL2;
if (attributes.useMetal && !platformSupportsMetal(m_isForWebGL2)) {
if (attributes.useMetal && !platformSupportsMetal()) {
attributes.useMetal = false;

0 comments on commit d386d62

Please sign in to comment.