commit 6cf057777555a5d0c834de3a0165a62916cf3b40 Author: Fredrik Höglund Date: Tue Oct 30 18:20:00 2012 +0100 kwin/glx: Avoid MSAA configs in initBufferConfigs() It appears that we're accidentally choosing an MSAA config with the Intel driver in Mesa 9.0. So change the algorithm to take the values of GLX_SAMPLES and GLX_SAMPLE_BUFFERS into account. Found by Kenneth Graunke. diff --git a/kwin/scene_opengl_glx.cpp b/kwin/scene_opengl_glx.cpp index 1fe2f18..cf7933b 100644 --- a/kwin/scene_opengl_glx.cpp +++ b/kwin/scene_opengl_glx.cpp @@ -270,12 +270,15 @@ bool SceneOpenGL::initBufferConfigs() fbcbuffer_nondb = NULL; for (int i = 0; i < 2; i++) { - int back, stencil, depth, caveat, alpha; + int back, stencil, depth, caveat, msaa_buffers, msaa_samples, alpha; back = i > 0 ? INT_MAX : 1; stencil = INT_MAX; depth = INT_MAX; caveat = INT_MAX; + msaa_buffers = INT_MAX; + msaa_samples = INT_MAX; alpha = 0; + for (int j = 0; j < cnt; j++) { XVisualInfo *vi; int visual_depth; @@ -322,10 +325,26 @@ bool SceneOpenGL::initBufferConfigs() GLX_CONFIG_CAVEAT, &caveat_value); if (caveat_value > caveat) continue; + + int msaa_buffers_value; + glXGetFBConfigAttrib(display(), fbconfigs[j], GLX_SAMPLE_BUFFERS, + &msaa_buffers_value); + if (msaa_buffers_value > msaa_buffers) + continue; + + int msaa_samples_value; + glXGetFBConfigAttrib(display(), fbconfigs[j], GLX_SAMPLES, + &msaa_samples_value); + if (msaa_samples_value > msaa_samples) + continue; + back = back_value; stencil = stencil_value; depth = depth_value; caveat = caveat_value; + msaa_buffers = msaa_buffers_value; + msaa_samples = msaa_samples_value; + if (i > 0) fbcbuffer_nondb = fbconfigs[ j ]; else