aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Gräßlin <mgraesslin@kde.org>2011-05-01 09:49:26 (GMT)
committerMartin Gräßlin <mgraesslin@kde.org>2011-05-01 09:52:19 (GMT)
commitafe966579d56f85444c432a3a6adf026d2941bd5 (patch)
tree5f579aad3ac71eeaffb7ec9d3d97c409136f9a8e
parent24384fe94aa36f28c323f58150aad0e4703b7331 (diff)
Enable direct rendering for all Mesa drivers
As KWin requires at least Mesa 7.10 for OpenGL we can be sure that all Mesa drivers support DRI2 and can enable direct rendering for it. Parsing the version string to identify if it is a mesa driver. This can cause breakage again in future versions of Mesa. Unfortunately version, vendor and renderer are the only information queryable just with OpenGL API. BUG: 270942 FIXED-IN: 4.7.0
-rw-r--r--kwin/opengltest/opengltest.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/kwin/opengltest/opengltest.cpp b/kwin/opengltest/opengltest.cpp
index d2d8f70..eda7b51 100644
--- a/kwin/opengltest/opengltest.cpp
+++ b/kwin/opengltest/opengltest.cpp
@@ -81,16 +81,9 @@ int main(int argc, char *argv[])
if ((major == 1 && minor < 3) && !strstr(glxExtensions, "GLX_EXT_texture_from_pixmap"))
return 1;
- // Assume that direct rendering works with DRI2 drivers
- const GLubyte *renderer = glGetString(GL_RENDERER);
- if (strstr((const char *)renderer, "DRI2"))
- return 0;
-
- // The Intel driver doesn't have DRI2 in the renderer string
- if (strstr((const char *)renderer, "GEM"))
- return 0;
-
- if (strstr((const char *)renderer, "Gallium"))
+ // Assume that all Mesa drivers support direct rendering
+ const GLubyte *version = glGetString(GL_VERSION);
+ if (strstr((const char *)version, "Mesa"))
return 0;
// Direct contexts also work with the NVidia driver