glx: Disable GLX_EXT_import_context if !enableIndirectGLX

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 <michel@daenzer.net>
This commit is contained in:
Adam Jackson 2019-08-22 15:07:18 -04:00
parent 4f27d1e05f
commit f8c85961c8
1 changed files with 6 additions and 2 deletions

View File

@ -31,8 +31,9 @@
* \author Ian Romanick <idr@us.ibm.com>
*/
#include <string.h>
#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");
}