glx: Fix drawable type inference in visual/fbconfig setup

This was just all kinds of wrong. Note that the comment implying "this
is a workaround for old XQuartz" is on the "not apple" side of the
ifdef. Anyway. xserver didn't start sending GLX_DRAWABLE_TYPE in the
fbconfig until:

    commit 8cde0af3c57f0375ba8ba77af9fdf74b79d9496d
    Author: Kristian Høgsberg <krh@redhat.com>
    Date:   Wed Apr 2 19:06:40 2008 -0400

        Send the GLX_EXT_texture_from_pixmap attributes to the client.

So we can remove this default from the fbconfig path. But we preserve it
for the GLXGetVisualConfigs path, because that is specified not to send
GLX_DRAWABLE_TYPE.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20549>
This commit is contained in:
Adam Jackson 2023-01-06 12:24:11 -05:00 committed by Marge Bot
parent 86c9a31d99
commit 2cc3763d04

View file

@ -651,18 +651,15 @@ createConfigsFromProperties(Display * dpy, int nvisuals, int nprops,
m = modes;
for (i = 0; i < nvisuals; i++) {
_XRead(dpy, (char *) props, prop_size);
#ifdef GLX_USE_APPLEGL
/* Older X servers don't send this so we default it here. */
m->drawableType = GLX_WINDOW_BIT;
#else
/*
* The XQuartz 2.3.2.1 X server doesn't set this properly, so
* set the proper bits here.
* AppleSGLX supports windows, pixmaps, and pbuffers with all config.
/* If this is GLXGetVisualConfigs then the reply will not include
* any drawable type info, but window support is implied because
* that's what a Visual describes, and pixmap support is implied
* because you almost certainly have a pixmap format corresponding
* to your visual format.
*/
m->drawableType = GLX_WINDOW_BIT | GLX_PIXMAP_BIT | GLX_PBUFFER_BIT;
#endif
__glXInitializeVisualConfigFromTags(m, nprops, props,
if (!tagged_only)
m->drawableType = GLX_WINDOW_BIT | GLX_PIXMAP_BIT;
__glXInitializeVisualConfigFromTags(m, nprops, props,
tagged_only, GL_TRUE);
m->screen = screen;
m = m->next;