summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2013-01-03 17:30:34 -0700
committerAndreas Boll <andreas.boll.dev@gmail.com>2013-02-13 18:46:39 +0100
commit3a39c3cb678e2b41b6d2edd4fe0ba8c6c381b614 (patch)
tree2875c0b354ea22d67d06fa356a76a275bcd14f7f
parent938b156d824d2dd34eea9247e0efc4467a3fc804 (diff)
st/glx: 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 fe90762414ea3191143a82534e304871c1e311a8)
-rw-r--r--src/gallium/state_trackers/glx/xlib/glx_api.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/glx/xlib/glx_api.c b/src/gallium/state_trackers/glx/xlib/glx_api.c
index 3619d5a2a9..3935c373ae 100644
--- a/src/gallium/state_trackers/glx/xlib/glx_api.c
+++ b/src/gallium/state_trackers/glx/xlib/glx_api.c
@@ -687,6 +687,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, 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) {