diff options
author | Brian Paul <brianp@vmware.com> | 2013-01-03 17:31:22 -0700 |
---|---|---|
committer | Andreas Boll <andreas.boll.dev@gmail.com> | 2013-02-13 18:46:39 +0100 |
commit | 938b156d824d2dd34eea9247e0efc4467a3fc804 (patch) | |
tree | a7683976e7a3bc5f7dfc2a5547f05137d30a1f63 | |
parent | cd95b673479f8a8ac3d5aabf387d33f705e156e9 (diff) | |
download | mesa3d-938b156d824d2dd34eea9247e0efc4467a3fc804.tar.gz |
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 <chad.versace@linux.intel.com>
(cherry picked from commit 46bad058eb1f2fa73a4db19655bc660dde1befb9)
-rw-r--r-- | src/mesa/drivers/x11/fakeglx.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index c30ba04a01c..ba01ede30b0 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -917,6 +917,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) { |