Prefer glxvisuals with stencil buffer for default visuals
The first fbconfig which has a depthbuffer > 0 and doublebuf is choosen when associating fbconfigs with the visuals, indepenent of stencil bits. This happens to work ok on intel as there all fbconfigs with a depthbuffer > 0 also have stencil bits. This patch fixes this by first trying to get a fbconfig for default X visuals with both stencilbuf, depthbuf and doublebuffering, and if that fails fallback to trying to get one with only a depthbuf and doublebuffering.
This commit is contained in:
parent
00effad583
commit
f6e22d69af
|
@ -437,6 +437,7 @@ initGlxVisual(VisualPtr visual, __GLXconfig *config)
|
|||
typedef struct {
|
||||
GLboolean doubleBuffer;
|
||||
GLboolean depthBuffer;
|
||||
GLboolean stencilBuffer;
|
||||
} FBConfigTemplateRec, *FBConfigTemplatePtr;
|
||||
|
||||
static __GLXconfig *
|
||||
|
@ -453,6 +454,8 @@ pickFBConfig(__GLXscreen *pGlxScreen, FBConfigTemplatePtr template, int class)
|
|||
continue;
|
||||
if ((config->depthBits > 0) != template->depthBuffer)
|
||||
continue;
|
||||
if ((config->stencilBits > 0) != template->stencilBuffer)
|
||||
continue;
|
||||
|
||||
return config;
|
||||
}
|
||||
|
@ -466,8 +469,9 @@ addMinimalSet(__GLXscreen *pGlxScreen)
|
|||
__GLXconfig *config;
|
||||
VisualPtr visuals;
|
||||
int i, j;
|
||||
FBConfigTemplateRec best = { GL_TRUE, GL_TRUE };
|
||||
FBConfigTemplateRec minimal = { GL_FALSE, GL_FALSE };
|
||||
FBConfigTemplateRec best = { GL_TRUE, GL_TRUE, GL_TRUE };
|
||||
FBConfigTemplateRec good = { GL_TRUE, GL_TRUE, GL_FALSE };
|
||||
FBConfigTemplateRec minimal = { GL_FALSE, GL_FALSE, GL_FALSE };
|
||||
|
||||
pGlxScreen->visuals = xcalloc(pGlxScreen->pScreen->numVisuals,
|
||||
sizeof (__GLXconfig *));
|
||||
|
@ -480,8 +484,11 @@ addMinimalSet(__GLXscreen *pGlxScreen)
|
|||
for (i = 0, j = 0; i < pGlxScreen->pScreen->numVisuals; i++) {
|
||||
if (visuals[i].nplanes == 32)
|
||||
config = pickFBConfig(pGlxScreen, &minimal, visuals[i].class);
|
||||
else
|
||||
else {
|
||||
config = pickFBConfig(pGlxScreen, &best, visuals[i].class);
|
||||
if (config == NULL)
|
||||
config = pickFBConfig(pGlxScreen, &good, visuals[i].class);
|
||||
}
|
||||
if (config == NULL)
|
||||
config = pGlxScreen->fbconfigs;
|
||||
if (config == NULL)
|
||||
|
|
Loading…
Reference in New Issue
Block a user