Bug 224888 - [CMake] Support USE_ANGLE_EGL on additional platforms
Summary: [CMake] Support USE_ANGLE_EGL on additional platforms
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CMake (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Don Olmstead
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-04-21 12:54 PDT by Don Olmstead
Modified: 2021-05-26 15:49 PDT (History)
15 users (show)

See Also:


Attachments
WIP Patch (22.46 KB, patch)
2021-04-21 12:57 PDT, Don Olmstead
no flags Details | Formatted Diff | Diff
WIP Patch (23.82 KB, patch)
2021-04-21 19:10 PDT, Don Olmstead
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
WIP Patch (32.71 KB, patch)
2021-04-23 14:51 PDT, Don Olmstead
no flags Details | Formatted Diff | Diff
Patch (35.60 KB, patch)
2021-05-12 13:37 PDT, Don Olmstead
kbr: review+
Details | Formatted Diff | Diff
WIP Patch (34.79 KB, patch)
2021-05-26 11:25 PDT, Don Olmstead
no flags Details | Formatted Diff | Diff
WIP Patch (35.48 KB, patch)
2021-05-26 12:18 PDT, Don Olmstead
no flags Details | Formatted Diff | Diff
WIP Patch (36.06 KB, patch)
2021-05-26 12:37 PDT, Don Olmstead
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
WIP Patch (37.04 KB, patch)
2021-05-26 13:03 PDT, Don Olmstead
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (38.80 KB, patch)
2021-05-26 13:58 PDT, Don Olmstead
no flags Details | Formatted Diff | Diff
Patch for Igalia to get started (2.29 KB, patch)
2021-05-26 14:06 PDT, Don Olmstead
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Don Olmstead 2021-04-21 12:54:24 PDT
...
Comment 1 Don Olmstead 2021-04-21 12:57:58 PDT Comment hidden (obsolete)
Comment 2 Don Olmstead 2021-04-21 19:10:12 PDT Comment hidden (obsolete)
Comment 3 EWS Watchlist 2021-04-21 19:11:49 PDT Comment hidden (obsolete)
Comment 4 Don Olmstead 2021-04-23 14:51:29 PDT
Created attachment 426951 [details]
WIP Patch
Comment 5 Radar WebKit Bug Importer 2021-04-28 12:55:19 PDT
<rdar://problem/77280211>
Comment 6 Don Olmstead 2021-05-12 13:37:00 PDT
Created attachment 428411 [details]
Patch
Comment 7 Kenneth Russell 2021-05-12 15:17:18 PDT
Comment on attachment 428411 [details]
Patch

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

Looks good to me overall - a few small comments. The real proof is whether things build with these changes. r+

> Source/ThirdParty/ANGLE/PlatformGTK.cmake:49
> +        list(APPEND ANGLE_DEFINITIONS WL_EGL_PLATFORM)

Understanding the comment above, still, won't some Wayland definitions be lost with this if/elseif construction if both X11 and Wayland are defined? Should that be fixed?

> Source/ThirdParty/ANGLE/PlatformGTK.cmake:50
> +    else ()

Wondering whether this should be something like if (!ENABLE_X11_TARGET && !ENABLE_WAYLAND_TARGET), and detached from this if/else chain.

> Source/WebKit/CMakeLists.txt:320
> +    # Prepend to make sure the ANGLE headers are found before system headers

This kind of search path manipulation seemed fragile, which is why the code elsewhere in WebKit that calls into ANGLE on macOS uses more explicitly-scoped include paths, and processing is/was done when publishing these headers to the outside world. Not 100% sure if this is exactly the same issue, but something to think about.

> Tools/Scripts/update-angle:169
> +./gni-to-cmake.py src/libANGLE/renderer/metal/BUILD.gn Metal.cmake --prepend 'src/libANGLE/renderer/metal/'

Great to see these updates.
Comment 8 Michael Catanzaro 2021-05-13 11:31:36 PDT
Comment on attachment 428411 [details]
Patch

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

>> Source/WebKit/CMakeLists.txt:320
>> +    # Prepend to make sure the ANGLE headers are found before system headers
> 
> This kind of search path manipulation seemed fragile, which is why the code elsewhere in WebKit that calls into ANGLE on macOS uses more explicitly-scoped include paths, and processing is/was done when publishing these headers to the outside world. Not 100% sure if this is exactly the same issue, but something to think about.

Won't this cause the UI process to link to ANGLE? I think the UI process should not be allowed to link to ANGLE? This could cause weird issues in applications that don't expect to wind up using WebKit's special private OpenGL rather than mesa, right? I wonder what Adrian thinks.
Comment 9 Don Olmstead 2021-05-26 11:25:28 PDT Comment hidden (obsolete)
Comment 10 Don Olmstead 2021-05-26 12:18:29 PDT Comment hidden (obsolete)
Comment 11 Don Olmstead 2021-05-26 12:37:56 PDT Comment hidden (obsolete)
Comment 12 Don Olmstead 2021-05-26 13:03:43 PDT Comment hidden (obsolete)
Comment 13 Don Olmstead 2021-05-26 13:58:02 PDT
Created attachment 429791 [details]
Patch
Comment 14 Don Olmstead 2021-05-26 14:01:18 PDT
Comment on attachment 428411 [details]
Patch

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

>> Source/ThirdParty/ANGLE/PlatformGTK.cmake:50
>> +    else ()
> 
> Wondering whether this should be something like if (!ENABLE_X11_TARGET && !ENABLE_WAYLAND_TARGET), and detached from this if/else chain.

This should be fixed in the patch for landing

>>> Source/WebKit/CMakeLists.txt:320
>>> +    # Prepend to make sure the ANGLE headers are found before system headers
>> 
>> This kind of search path manipulation seemed fragile, which is why the code elsewhere in WebKit that calls into ANGLE on macOS uses more explicitly-scoped include paths, and processing is/was done when publishing these headers to the outside world. Not 100% sure if this is exactly the same issue, but something to think about.
> 
> Won't this cause the UI process to link to ANGLE? I think the UI process should not be allowed to link to ANGLE? This could cause weird issues in applications that don't expect to wind up using WebKit's special private OpenGL rather than mesa, right? I wonder what Adrian thinks.

This is potentially fragile BUT this shouldn't be a problem for GTK Michael.

USE_ANGLE_EGL means use ANGLE as the OpenGL ES implementation for everything. So GTK won't hit that because it compiles with USE_ANGLE_WEBGL which just means use ANGLE for WebGL support and that's it.
Comment 15 Don Olmstead 2021-05-26 14:04:59 PDT
Ok so I believe I have addressed all concerns with this patch.

The GTK EWS for the last patch ran successfully with USE_ANGLE_WEBGL enabled. It had some local changes that aren't for upstream but were just to get a green build. I'm sure there's probably more changes for GTK but I feel this patch is good to go and anything else with getting GTK working should be done in a follow up.
Comment 16 Don Olmstead 2021-05-26 14:06:25 PDT
Created attachment 429792 [details]
Patch for Igalia to get started

This contains the local changes to get EWS to complete successfully to continue investigation of turning on ANGLE for WebGL 2 on GTK.
Comment 17 Kenneth Russell 2021-05-26 14:25:28 PDT
Comment on attachment 429791 [details]
Patch

Latest patch still looks good to me.
Comment 18 Michael Catanzaro 2021-05-26 14:32:59 PDT
(In reply to Don Olmstead from comment #14)
> This is potentially fragile BUT this shouldn't be a problem for GTK Michael.
> 
> USE_ANGLE_EGL means use ANGLE as the OpenGL ES implementation for
> everything. So GTK won't hit that because it compiles with USE_ANGLE_WEBGL
> which just means use ANGLE for WebGL support and that's it.

OK, I agree this would only be a problem if USE_ANGLE_EGL were to be turned on.
Comment 19 EWS 2021-05-26 15:49:22 PDT
Committed r278130 (238180@main): <https://commits.webkit.org/238180@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 429791 [details].