From 46bad058eb1f2fa73a4db19655bc660dde1befb9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 3 Jan 2013 17:31:22 -0700 Subject: [PATCH] xlib: allow GLX_DONT_CARE for glXChooseFBConfig() attribute values Fixes piglit glx-dont-care-mask test. Note: This is a candidate for the stable branches. Reviewed-by: Chad Versace --- src/mesa/drivers/x11/fakeglx.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index 3dca405304f..2208d5e7f77 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -911,6 +911,20 @@ choose_visual( Display *dpy, int screen, const int *list, GLboolean fbConfig ) while (*parselist) { + if (fbConfig && + parselist[1] == GLX_DONT_CARE && + parselist[0] != GLX_LEVEL) { + /* For glXChooseFBConfig(), skip attributes whose value is + * GLX_DONT_CARE (-1), unless it's GLX_LEVEL (which can legitimately be + * a negative value). + * + * From page 17 (23 of the pdf) of the GLX 1.4 spec: + * GLX DONT CARE may be specified for all attributes except GLX LEVEL. + */ + parselist += 2; + continue; + } + switch (*parselist) { case GLX_USE_GL: if (fbConfig) { -- 2.30.2