diff options
Diffstat (limited to 'xorg-server/glx')
-rwxr-xr-x | xorg-server/glx/glxext.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/xorg-server/glx/glxext.c b/xorg-server/glx/glxext.c index f95b4e339..64fa0ba55 100755 --- a/xorg-server/glx/glxext.c +++ b/xorg-server/glx/glxext.c @@ -321,6 +321,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. */ @@ -339,6 +356,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, |