dri: Try harder to infer the drawable fbconfig if needed
authorAdam Jackson <ajax@redhat.com>
Fri, 16 Apr 2021 17:59:29 +0000 (13:59 -0400)
committerMarge Bot <eric+marge@anholt.net>
Thu, 22 Apr 2021 18:11:52 +0000 (18:11 +0000)
commit5a613c55eba545f16228933da70ef5196680013d
tree5b373bc3062cf381b0434a9aa5d0e9799c740f83
parent134af5ada240d163fee91c2d8cbf5128590d7c86
dri: Try harder to infer the drawable fbconfig if needed

This code would work for GLXWindows but not for bare Windows, which I
guess you could argue is a server bug but which we can fix on the client
side with a little effort. We change __glXGetDrawableAttribute to
additionally return false if we failed to find the requested attribute
(which is safe, all the other callers discard the return value). Then
when inferring the fbconfig, if the attribute wasn't found, we ask for
the window attributes to find the visual ID and use that to find the
fbconfig.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10381>
src/glx/dri_common.c
src/glx/glx_pbuffer.c