Bug 204446 - [GTK] Check EGL image extension by using native gl API in AcceleratedBackingStoreWayland
Summary: [GTK] Check EGL image extension by using native gl API in AcceleratedBackingS...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: ChangSeok Oh
URL:
Keywords:
Depends on:
Blocks: 199060
  Show dependency treegraph
 
Reported: 2019-11-21 00:28 PST by ChangSeok Oh
Modified: 2019-11-27 00:25 PST (History)
4 users (show)

See Also:


Attachments
Patch (4.46 KB, patch)
2019-11-21 00:50 PST, ChangSeok Oh
no flags Details | Formatted Diff | Diff
Patch (4.51 KB, patch)
2019-11-21 01:07 PST, ChangSeok Oh
no flags Details | Formatted Diff | Diff
Patch (4.13 KB, patch)
2019-11-23 01:54 PST, ChangSeok Oh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ChangSeok Oh 2019-11-21 00:28:05 PST
This is part of efforts bringing ANGLE support for WebGL to gtk port.
Comment 1 ChangSeok Oh 2019-11-21 00:50:27 PST
Created attachment 384034 [details]
Patch
Comment 2 ChangSeok Oh 2019-11-21 01:07:59 PST
Created attachment 384035 [details]
Patch
Comment 3 Carlos Garcia Campos 2019-11-22 05:04:04 PST
Comment on attachment 384035 [details]
Patch

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

> Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:84
> +        if (!availableExtensions.contains("GL_ARB_texture_storage"_s)) {
> +            GLint majorVersion;
> +            ::glGetIntegerv(GL_MAJOR_VERSION, &majorVersion);
> +            GLint minorVersion;
> +            ::glGetIntegerv(GL_MINOR_VERSION, &minorVersion);
> +            if (majorVersion > 4 || (majorVersion == 4 && minorVersion >= 2))
> +                availableExtensions.add("GL_ARB_texture_storage"_s);
> +            }

We can simply this, since are only interested in GL_OES_EGL_image and glEGLImageTargetTexture2DOES we don't need to handle this exception here for GL_ARB_texture_storage.

> Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:115
> +        if (availableExtensions.contains("GL_OES_EGL_image") || availableExtensions.contains("GL_OES_EGL_image_external"))

If we are going to build the list of extensions here, we can simplify this even more. Let's just add checkEGLImageAvailable (or something like that) and check any of those are available using the gl api directly, instead of first building a has set to then check if any of those are present.
Comment 4 ChangSeok Oh 2019-11-23 01:54:57 PST
Created attachment 384234 [details]
Patch
Comment 5 ChangSeok Oh 2019-11-23 01:55:53 PST
Comment on attachment 384035 [details]
Patch

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

>> Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:84
>> +            }
> 
> We can simply this, since are only interested in GL_OES_EGL_image and glEGLImageTargetTexture2DOES we don't need to handle this exception here for GL_ARB_texture_storage.

You're right.

>> Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:115
>> +        if (availableExtensions.contains("GL_OES_EGL_image") || availableExtensions.contains("GL_OES_EGL_image_external"))
> 
> If we are going to build the list of extensions here, we can simplify this even more. Let's just add checkEGLImageAvailable (or something like that) and check any of those are available using the gl api directly, instead of first building a has set to then check if any of those are present.

That is a good suggestion. Thanks!
Comment 6 WebKit Commit Bot 2019-11-25 02:08:46 PST
Comment on attachment 384234 [details]
Patch

Clearing flags on attachment: 384234

Committed r252851: <https://trac.webkit.org/changeset/252851>
Comment 7 WebKit Commit Bot 2019-11-25 02:08:48 PST
All reviewed patches have been landed.  Closing bug.