From f8c85961c8fcb283e4ed6fc2b942428e4da2d093 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Thu, 22 Aug 2019 15:07:18 -0400 Subject: [PATCH] glx: Disable GLX_EXT_import_context if !enableIndirectGLX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GLX_EXT_import_context allows multiple clients to share the same indirect context. If you can't create an indirect context, you're certainly not going to be able to share one. Hide the extension from the server string if we've disabled indirect contexts. This turns piglit's tests from fail to skip when indirect contexts are disabled. Since GLX_EXT_import_context has been supported in xfree86-derived servers since day 1 (it was included in the initial GLX code drop from SGI), this is now also a hint to the client that indirect contexts are unlikely to work at all. Reviewed-by: Michel Dänzer --- glx/extension_string.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/glx/extension_string.c b/glx/extension_string.c index 354ce06f7..d7e2c7242 100644 --- a/glx/extension_string.c +++ b/glx/extension_string.c @@ -31,8 +31,9 @@ * \author Ian Romanick */ -#include +#include "dix-config.h" #include "extension_string.h" +#include "opaque.h" #define SET_BIT(m,b) (m[ (b) / 8 ] |= (1U << ((b) % 8))) #define CLR_BIT(m,b) (m[ (b) / 8 ] &= ~(1U << ((b) % 8))) @@ -85,7 +86,7 @@ static const struct extension_info known_glx_extensions[] = { { GLX(EXT_create_context_es2_profile), VER(0,0), N, }, { GLX(EXT_fbconfig_packed_float), VER(0,0), N, }, { GLX(EXT_framebuffer_sRGB), VER(0,0), N, }, - { GLX(EXT_import_context), VER(0,0), Y, }, + { GLX(EXT_import_context), VER(0,0), N, }, { GLX(EXT_libglvnd), VER(0,0), N, }, { GLX(EXT_no_config_context), VER(0,0), N, }, { GLX(EXT_stereo_tree), VER(0,0), N, }, @@ -177,4 +178,7 @@ __glXInitExtensionEnableBits(unsigned char *enable_bits) SET_BIT(enable_bits, known_glx_extensions[i].bit); } } + + if (enableIndirectGLX) + __glXEnableExtension(enable_bits, "GLX_EXT_import_context"); }