mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 03:08:05 +02:00
GLX/DRI1: Mark GLX visuals with depth != screen depth non-conformant.
Such visuals are subject to automatic compositing in the X server, so DRI1 can't render to them properly.
This commit is contained in:
parent
96601ec8e0
commit
25b492b976
1 changed files with 23 additions and 0 deletions
|
|
@ -305,6 +305,7 @@ CallCreateNewScreen(Display *dpy, int scrn, __GLXscreenConfigs *psc,
|
|||
drm_handle_t hFB;
|
||||
int junk;
|
||||
const __DRIconfig **driver_configs;
|
||||
__GLcontextModes *visual;
|
||||
|
||||
/* DRI protocol version. */
|
||||
dri_version.major = driDpy->driMajor;
|
||||
|
|
@ -417,6 +418,28 @@ CallCreateNewScreen(Display *dpy, int scrn, __GLXscreenConfigs *psc,
|
|||
psc->configs = driConvertConfigs(psc->core, psc->configs, driver_configs);
|
||||
psc->visuals = driConvertConfigs(psc->core, psc->visuals, driver_configs);
|
||||
|
||||
/* Visuals with depth != screen depth are subject to automatic compositing
|
||||
* in the X server, so DRI1 can't render to them properly. Mark them as
|
||||
* non-conformant to prevent apps from picking them up accidentally.
|
||||
*/
|
||||
for (visual = psc->visuals; visual; visual = visual->next) {
|
||||
XVisualInfo template;
|
||||
XVisualInfo *visuals;
|
||||
int num_visuals;
|
||||
long mask;
|
||||
|
||||
template.visualid = visual->visualID;
|
||||
mask = VisualIDMask;
|
||||
visuals = XGetVisualInfo(dpy, mask, &template, &num_visuals);
|
||||
|
||||
if (visuals) {
|
||||
if (num_visuals > 0 && visuals->depth != DefaultDepth(dpy, scrn))
|
||||
visual->visualRating = GLX_NON_CONFORMANT_CONFIG;
|
||||
|
||||
XFree(visuals);
|
||||
}
|
||||
}
|
||||
|
||||
return psp;
|
||||
|
||||
handle_error:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue