Bug 219661 - Add runtime flag for ANGLE on Metal
Summary: Add runtime flag for ANGLE on Metal
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dean Jackson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-12-08 17:20 PST by Dean Jackson
Modified: 2020-12-10 10:58 PST (History)
12 users (show)

See Also:


Attachments
Patch (6.01 KB, patch)
2020-12-08 17:24 PST, Dean Jackson
no flags Details | Formatted Diff | Diff
Patch (9.02 KB, patch)
2020-12-09 15:04 PST, Dean Jackson
sam: review+
Details | Formatted Diff | Diff
EWS test (8.95 KB, patch)
2020-12-10 09:22 PST, Dean Jackson
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
EWS test 2 (9.01 KB, patch)
2020-12-10 09:36 PST, Dean Jackson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>