Bug 219661

Summary: Add runtime flag for ANGLE on Metal
Product: WebKit Reporter: Dean Jackson <dino>
Component: WebGLAssignee: Dean Jackson <dino>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, changseok, dino, esprehn+autocc, ews-watchlist, graouts, gyuyoung.kim, jdarpinian, kbr, kondapallykalyan, sam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
sam: review+
EWS test
ews-feeder: commit-queue-
EWS test 2 none

Description Dean Jackson 2020-12-08 17:20:28 PST
Add runtime flag for ANGLE on Metal
Comment 1 Dean Jackson 2020-12-08 17:21:12 PST
<rdar://problem/69061894>
Comment 2 Dean Jackson 2020-12-08 17:24:21 PST
Created attachment 415694 [details]
Patch
Comment 3 Sam Weinig 2020-12-09 08:37:08 PST
Comment on attachment 415694 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=415694&action=review

> Source/WebCore/platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:99
> +    if (RuntimeEnabledFeatures::sharedFeatures().webGLUsingMetal()) {

This is a layering violation. Code in platform/ is not allowed to use RuntimeEnabledFeatures as it is not a platform concept.

Instead, the check should be done by the WebCore code that creates this object, and it should pass down this state.
Comment 4 Dean Jackson 2020-12-09 15:04:05 PST
Created attachment 415800 [details]
Patch
Comment 5 Sam Weinig 2020-12-09 15:06:53 PST
Comment on attachment 415800 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=415800&action=review

> Source/WebCore/platform/graphics/GraphicsContextGLAttributes.h:56
> +#if PLATFORM(COCOA)

Might be slightly nicer to wrap these in HAVE(METAL) rather than PLATFORM(COCOA), but I am not sure that exists yet.
Comment 6 Sam Weinig 2020-12-09 15:08:25 PST
Comment on attachment 415800 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=415800&action=review

> Source/WebCore/platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:105
> +    display = EGL_GetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, reinterpret_cast<void *>(EGL_DEFAULT_DISPLAY), displayAttributes.data());

Existing, but this should be reinterpret_cast<void*> (no space after void.)
Comment 7 Dean Jackson 2020-12-10 09:22:42 PST
Created attachment 415884 [details]
EWS test
Comment 8 Dean Jackson 2020-12-10 09:36:08 PST
Created attachment 415887 [details]
EWS test 2
Comment 9 Dean Jackson 2020-12-10 10:58:37 PST
Committed r270636: <https://trac.webkit.org/changeset/270636>