From a8bb3295b467d35d26bc33c11797b516ba775903 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 16 Jan 2023 01:02:47 +0100 Subject: X11GLXContext.getPlatformExtensionsStringImpl(): Add comment from pull request regarding GLX extensions https://github.com/sgothel/jogl/pull/107 Return either glXQueryClientString or glXQueryExtensionsString when getting the GLX extensions ndjojo: glXQueryExtensionsString will make a request for glXQueryServerString if needed and will append the necessary client-side extensions. This doc, under the section "Using GLS Extensions", also suggests checking the glXQueryExtensionsString before using GLX extensions. +++ aschleck: For some more context this came up with the release of Mesa 20.3.0, which has client support for GLX_EXT_swap_control but no server support. The current JOGL behavior of appending the client extensions to the server extensions is incorrect. They should instead be intersected (with client-only extensions then appended) as the doc Nicole linked above says, which is precisely what glXQueryExtensionsString does. With the current extension querying behavior JOGL thinks glXSwapIntervalEXT is available under Mesa/llvmpipe even though it is not, causing a segfault at JOGL initialization time. I originally filed this as a Mesa bug (https://gitlab.freedesktop.org/mesa/mesa/-/issues/4128) along with some code that repro'd JOGL's checking behavior but it became apparent that Mesa is fine and the checking behavior is incorrect. --- src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/jogl/classes/jogamp/opengl/x11/glx') diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java index 1204432b4..ec1230894 100644 --- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java +++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java @@ -551,6 +551,10 @@ public class X11GLXContext extends GLContextImpl { ", server: "+ GLXUtil.getGLXServerVersionNumber(x11Device)); } if(((X11GLXDrawableFactory)drawable.getFactoryImpl()).isGLXVersionGreaterEqualOneOne(x11Device)) { + /** + * Return either glXQueryClientString or glXQueryExtensionsString when getting the GLX extensions + * https://github.com/sgothel/jogl/pull/107 + */ if (ns.getScreenIndex() < 0) { final String ret = GLX.glXGetClientString(x11Device.getHandle(), GLX.GLX_EXTENSIONS); if (DEBUG) { -- cgit v1.2.3