glx: Require at least one True/DirectColor visual
Mesa no longer supports rendering to anything less. GLX 1.2 requires that the server advertise at least one GLX visual. GLX 1.3 and 1.4 are more subtle: they require at least one fbconfig capable of window rendering, and _also_ require that window-capable fbconfigs have a non-zero value for the GLX_VISUAL_ID. In either case we should refuse to init GLX if there's not at least one GL-capable visual on at least one screen. Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
6d684f916b
commit
db2e708f31
21
glx/glxext.c
21
glx/glxext.c
|
@ -316,6 +316,23 @@ GlxPushProvider(__GLXprovider * provider)
|
|||
__glXProviderStack = provider;
|
||||
}
|
||||
|
||||
static Bool
|
||||
checkScreenVisuals(void)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
for (i = 0; i < screenInfo.numScreens; i++) {
|
||||
ScreenPtr screen = screenInfo.screens[i];
|
||||
for (j = 0; j < screen->numVisuals; j++) {
|
||||
if (screen->visuals[j].class == TrueColor ||
|
||||
screen->visuals[j].class == DirectColor)
|
||||
return True;
|
||||
}
|
||||
}
|
||||
|
||||
return False;
|
||||
}
|
||||
|
||||
/*
|
||||
** Initialize the GLX extension.
|
||||
*/
|
||||
|
@ -334,6 +351,10 @@ GlxExtensionInit(void)
|
|||
*stack = &__glXDRISWRastProvider;
|
||||
}
|
||||
|
||||
/* Mesa requires at least one True/DirectColor visual */
|
||||
if (!checkScreenVisuals())
|
||||
return;
|
||||
|
||||
__glXContextRes = CreateNewResourceType((DeleteType) ContextGone,
|
||||
"GLXContext");
|
||||
__glXDrawableRes = CreateNewResourceType((DeleteType) DrawableGone,
|
||||
|
|
Loading…
Reference in New Issue