Bug 178719 - [GTK] When using EGL, request an OpenGL core profile when possible
Summary: [GTK] When using EGL, request an OpenGL core profile when possible
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Miguel Gomez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-24 02:45 PDT by Miguel Gomez
Modified: 2018-03-16 04:52 PDT (History)
3 users (show)

See Also:


Attachments
Patch (10.52 KB, patch)
2018-03-16 02:39 PDT, Miguel Gomez
no flags Details | Formatted Diff | Diff
Patch (10.16 KB, patch)
2018-03-16 03:25 PDT, Miguel Gomez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Miguel Gomez 2017-10-24 02:45:45 PDT
When using GLX, we try to get an OpenGL 3.2 core profile when possible, and fall back to whatever is available if not. But we are not doing this with EGL, and we just use what EGL wants to give us. We need to implement the capability to request an OpenGL 3.2 core profile as well when possible with EGL as well.

From that I read, the required EGL API for this is available since EGL 1.5 or EGL 1.4 if the extension EGL_KHR_create_context is available.
Comment 1 Miguel Gomez 2018-03-16 02:39:35 PDT
Created attachment 335924 [details]
Patch
Comment 2 Carlos Garcia Campos 2018-03-16 02:52:14 PDT
Comment on attachment 335924 [details]
Patch

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

> Source/WebCore/platform/graphics/egl/GLContextEGL.cpp:379
> +        String versionString = String(reinterpret_cast<const char*>(eglQueryString(display, EGL_VERSION)));
> +        Vector<String> versionStringComponents;
> +        versionString.split(' ', versionStringComponents);
> +        Vector<String> versionDigits;
> +        versionStringComponents[0].split('.', versionDigits);
> +        uint version = versionDigits[0].toUInt() * 100 + versionDigits[1].toUInt() * 10;

I don't think we need to parse the version here again. We already have the version parsed when EGL is initialized in PlatformDisplay. I guess we could simply pass the PlatformDisplay here instead of the EGLDisplay and use PlatformDisplay::eglCheckVersion()

> Source/WebCore/platform/graphics/egl/GLContextEGL.cpp:417
> +        contextAttributesInitialized = true;

We are doing this in all the cases inside the if, no? I think we can dot this once at the beginning.
Comment 3 Miguel Gomez 2018-03-16 03:25:13 PDT
Created attachment 335926 [details]
Patch
Comment 4 WebKit Commit Bot 2018-03-16 04:52:03 PDT
Comment on attachment 335926 [details]
Patch

Clearing flags on attachment: 335926

Committed r229663: <https://trac.webkit.org/changeset/229663>
Comment 5 WebKit Commit Bot 2018-03-16 04:52:04 PDT
All reviewed patches have been landed.  Closing bug.