<div dir="ltr">Thanks Lukasz. ll look into the points brought up.<div><br></div><div>I'm unsure on scenarios where GLX will work and EGL will not, but Gtk has GLX fallback. I will look into it (maybe ask on a Mesa development channel). The force flag is a nice idea.</div><div><br>It's not a formal JBS issue yet because I don't know if it fits the JavaFX roadmap, or if there are any other efforts on doing it. It's a "step 1" for wayland support.<div>This is the initial feedback I was looking for. I'm willing to invest time on this, but not if it will never be accepted.</div><div><br></div><div>-- Thiago.</div><div><br></div><div><br></div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Em ter., 2 de abr. de 2024 às 09:45, Lukasz Kostyra <<a href="mailto:notifications@github.com">notifications@github.com</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><p></p>
<p><b>@lukostyra</b> commented on this pull request.</p>
<p dir="auto">I took a brief look at your changes and I shared some comments.</p>
<p dir="auto">Overall the changes look good. The EGL/GLX loading in GLFactory feels a bit hacky, but other than making EGL a completely separate Prism backend (which would duplicate/reorganize a lot of common EGL/GLX code - definitely a no-go IMO) I don't have a better idea how to solve this. Maybe with an ES2-specific property like <code class="gmail-notranslate">prism.es2.forceglx=true</code>?</p>
<p dir="auto">This brings me to a question - other than some form of debugging/fallback for when EGL is still new to JFX, do we even need GLX implementation when we have a working EGL implementation? I'm fairly sure that current distros (especially ones officially supported by JFX) have EGL support available at this point in time, and since it's an intermediary layer between application and runtime it shouldn't depend on used GPU.</p><hr>
<p>In <a href="https://github.com/openjdk/jfx/pull/1381#discussion_r1547684895" target="_blank">modules/javafx.graphics/src/main/native-prism-es2/linux/egl/LinuxGLContext.c</a>:</p>
<pre style="color:rgb(85,85,85)">> +
+ eglExtensions = (const char *) eglQueryString(eglDisplay, EGL_EXTENSIONS);
+ if (eglExtensions == NULL) {
+ eglDestroyContext(eglDisplay, eglContext);
+ fprintf(stderr, "eglExtensions == null\n");
+ return 0;
+ }
+
+ /*
+ fprintf(stderr, "glExtensions: %s\n", glExtensions);
+ fprintf(stderr, "glxExtensions: %s\n", glxExtensions);
+ */
+
+ /* allocate the structure */
+ ctxInfo = (ContextInfo *) malloc(sizeof (ContextInfo));
+ if (ctxInfo == NULL) {
</pre>
<p dir="auto">Shouldn't this also <code class="gmail-notranslate">eglDestroyContext</code>?</p>
<hr>
<p>In <a href="https://github.com/openjdk/jfx/pull/1381#discussion_r1547688868" target="_blank">modules/javafx.graphics/src/main/native-prism-es2/linux/egl/LinuxGLContext.c</a>:</p>
<pre style="color:rgb(85,85,85)">> + }
+
+ /* initialize the structure */
+ initializeCtxInfo(ctxInfo);
+ ctxInfo->versionStr = strdup(glVersion);
+ ctxInfo->vendorStr = strdup(glVendor);
+ ctxInfo->rendererStr = strdup(glRenderer);
+ ctxInfo->glExtensionStr = strdup(glExtensions);
+ ctxInfo->eglExtensionStr = strdup(eglExtensions);
+ ctxInfo->versionNumbers[0] = versionNumbers[0];
+ ctxInfo->versionNumbers[1] = versionNumbers[1];
+ ctxInfo->context = eglContext;
+
+ /* set function pointers */
+ ctxInfo->glActiveTexture = (PFNGLACTIVETEXTUREPROC)
+ dlsym(RTLD_DEFAULT, "glActiveTexture");
</pre>
<p dir="auto">Since you're using EGL, it would be better to use EGL's own <code class="gmail-notranslate">eglGetProcAddress</code> here and below.</p>
<hr>
<p>In <a href="https://github.com/openjdk/jfx/pull/1381#discussion_r1547718158" target="_blank">modules/javafx.graphics/src/main/java/com/sun/prism/es2/LinuxEGLContext.java</a>:</p>
<pre style="color:rgb(85,85,85)">> @@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
</pre>
<p dir="auto">Copyright dates should be updated (here and in other files)</p>
<p style="font-size:small;color:rgb(102,102,102)">—<br>Reply to this email directly, <a href="https://github.com/openjdk/jfx/pull/1381#pullrequestreview-1973486376" target="_blank">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AHKIFHRJWJBPAPXKZHIHLO3Y3KR6HAVCNFSM6AAAAABDYFPNMCVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTSNZTGQ4DMMZXGY" target="_blank">unsubscribe</a>.<br>You are receiving this because you were mentioned.<img src="https://github.com/notifications/beacon/AHKIFHRFBLAV7N7PKNPFWQTY3KR6HA5CNFSM6AAAAABDYFPNMCWGG33NNVSW45C7OR4XAZNRKB2WY3CSMVYXKZLTORJGK5TJMV32UY3PNVWWK3TUL5UWJTTVUEBSQ.gif" height="1" width="1" alt=""><span style="color:transparent;font-size:0px;display:none;overflow:hidden;opacity:0;width:0px;height:0px;max-width:0px;max-height:0px">Message ID: <span><openjdk/jfx/pull/1381/review/1973486376</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
</blockquote></div>