RFR: 8329820: [Linux] Prefer EGL over GLX
Thiago Milczarek Sayao
tsayao at openjdk.org
Sat Apr 6 16:31:26 UTC 2024
On Tue, 2 Apr 2024 11:50:39 GMT, Lukasz Kostyra <lkostyra at openjdk.org> wrote:
>> GLX is X only while EGL is need for Wayland and also works with X.org.
>>
>> I know there are limitations on Xorg and I still need to investigate it.
>>
>> GLX replacement for Xorg is not mandatory - this can be further discussed.
>>
>> This is a work in progress and it's on the first step (making it work).
>>
>> See:
>> [Switching the Linux graphics stack from GLX to EGL](https://mozillagfx.wordpress.com/2021/10/30/switching-the-linux-graphics-stack-from-glx-to-egl/)
>> [Prefer EGL to GLX for the GL support on X11](https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/3540)
>
> modules/javafx.graphics/src/main/java/com/sun/prism/es2/LinuxEGLContext.java line 2:
>
>> 1: /*
>> 2: * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
>
> Copyright dates should be updated (here and in other files)
Fixed
> modules/javafx.graphics/src/main/native-prism-es2/linux/egl/LinuxGLContext.c line 140:
>
>> 138: /* allocate the structure */
>> 139: ctxInfo = (ContextInfo *) malloc(sizeof (ContextInfo));
>> 140: if (ctxInfo == NULL) {
>
> Shouldn't this also `eglDestroyContext`?
Added
> modules/javafx.graphics/src/main/native-prism-es2/linux/egl/LinuxGLContext.c line 158:
>
>> 156: /* set function pointers */
>> 157: ctxInfo->glActiveTexture = (PFNGLACTIVETEXTUREPROC)
>> 158: dlsym(RTLD_DEFAULT, "glActiveTexture");
>
> Since you're using EGL, it would be better to use EGL's own `eglGetProcAddress` here and below.
Yes - changed.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1381#discussion_r1554636413
PR Review Comment: https://git.openjdk.org/jfx/pull/1381#discussion_r1554635523
PR Review Comment: https://git.openjdk.org/jfx/pull/1381#discussion_r1554635568
More information about the openjfx-dev
mailing list