summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Grenville <pyxlcy@gmail.com>2013-09-03 21:14:40 +0800
committerRichard Grenville <pyxlcy@gmail.com>2013-09-03 21:14:40 +0800
commitfc117ad4f8ec65344a58308a86b48965e574004f (patch)
treef89074361f461197e491674c5bda896f69b0c06b
parent17c318b44a4534262499eca771ea878182769a13 (diff)
downloadtdebase-fc117ad4.tar.gz
tdebase-fc117ad4.zip
Misc: GLX: Avoid using multi-sampling visuals
Avoid using multi-sampled visuals, like the cogl patch: http://people.freedesktop.org/~glisse/0001-glx-do-not-use-multisample-visual-config-for-front-o.patch
-rw-r--r--opengl.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/opengl.c b/opengl.c
index a788cd509..a26a286f4 100644
--- a/opengl.c
+++ b/opengl.c
@@ -386,6 +386,14 @@ glx_update_fbconfig(session_t *ps) {
int id = (int) (pcur - pfbcfgs);
int depth = 0, depth_alpha = 0, val = 0;
+ // Skip over multi-sampled visuals
+ // http://people.freedesktop.org/~glisse/0001-glx-do-not-use-multisample-visual-config-for-front-o.patch
+#ifdef GLX_SAMPLES
+ if (Success == glXGetFBConfigAttrib(ps->dpy, *pcur, GLX_SAMPLES, &val)
+ && val > 1)
+ continue;
+#endif
+
if (Success != glXGetFBConfigAttrib(ps->dpy, *pcur, GLX_BUFFER_SIZE, &depth)
|| Success != glXGetFBConfigAttrib(ps->dpy, *pcur, GLX_ALPHA_SIZE, &depth_alpha)) {
printf_errf("(): Failed to retrieve buffer size and alpha size of FBConfig %d.", id);
@@ -405,7 +413,7 @@ glx_update_fbconfig(session_t *ps) {
continue;
}
visualdepth = pvi->depth;
- cxfree(pvi);
+ cxfree(pvi);
}
bool rgb = false;
@@ -446,6 +454,12 @@ glx_update_fbconfig(session_t *ps) {
printf_errf("(): No FBConfig found for depth 32. Expect crazy things.");
}
+#ifdef DEBUG_GLX
+ printf_dbgf("(): %d-bit: %#3x, 32-bit: %#3x\n",
+ ps->depth, (int) ps->glx_fbconfigs[ps->depth]->cfg,
+ (int) ps->glx_fbconfigs[32]->cfg);
+#endif
+
return true;
}