jogl icon indicating copy to clipboard operation
jogl copied to clipboard

Return either glXQueryClientString or glXQueryExtensionsString when getting the GLX extensions

Open ndjojo opened this issue 4 years ago • 1 comments

glXQueryExtensionsString will make a request for glXQueryServerString if needed and will append the necessary client-side extensions (more information in this doc, under the section "Extension availability").

This doc, under the section "Using GLS Extensions", also suggests checking the glXQueryExtensionsString before using GLX extensions.

ndjojo avatar Jan 20 '21 23:01 ndjojo

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.

aschleck avatar Jan 20 '21 23:01 aschleck