mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-30 20:50:09 +01:00
glx: fix regression for drawable type detection
Newer version of XServer supporting GLX_DRAWABLE_TYPE query also
support query with raw X11 window ID besides GLXWindow ID. So we
should not limit the suppported type to GLXPbuffer when query
success.
Otherwise can't start GLX application on newer XServer with:
libGL error: GLX drawable type is not supported
libGL error: GLX drawable type is not supported
X Error of failed request: GLXBadContext
Major opcode of failed request: 149 (GLX)
Minor opcode of failed request: 5 (X_GLXMakeCurrent)
Serial number of failed request: 35
Current serial number in output stream: 35
Fixes: 6625c960c5 ("glx: check drawable type before create drawble")
Tested-by: Mike Lothian <mike@fireburn.co.uk>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14120>
This commit is contained in:
parent
ff74d5dd1b
commit
c50bdacbda
1 changed files with 4 additions and 6 deletions
|
|
@ -392,15 +392,13 @@ driFetchDrawable(struct glx_context *gc, GLXDrawable glxDrawable)
|
|||
|
||||
/* Infer the GLX drawable type. */
|
||||
if (__glXGetDrawableAttribute(dpy, glxDrawable, GLX_DRAWABLE_TYPE, &type)) {
|
||||
if (type != GLX_PBUFFER_BIT) {
|
||||
ErrorMessageF("GLX drawable type is not supported\n");
|
||||
/* Xserver may support query with raw X11 window. */
|
||||
if (type == GLX_PIXMAP_BIT) {
|
||||
ErrorMessageF("GLXPixmap drawable type is not supported\n");
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
/* Xserver may not implement GLX_DRAWABLE_TYPE query yet, or glxDrawable
|
||||
* is a X window. Assume it's a GLXPbuffer in former case, because we don't
|
||||
* know GLXPixmap and GLXWindow's X drawable ID anyway.
|
||||
*/
|
||||
/* Xserver may not implement GLX_DRAWABLE_TYPE query yet. */
|
||||
type = GLX_PBUFFER_BIT | GLX_WINDOW_BIT;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue