From 1bcf95f3f94aa3128c1323f8e9eb6d123a5d9793 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=B6glund?= Date: Wed, 13 Mar 2013 16:43:19 +0100 Subject: [PATCH] kwin: Fix VBO function resolution for core contexts Mesa doesn't advertise extensions that were core in 1.5 in an OpenGL context that uses the core profile. --- libkwineffects/kwinglutils.cpp | 2 +- libkwineffects/kwinglutils_funcs.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/libkwineffects/kwinglutils.cpp b/libkwineffects/kwinglutils.cpp index 774c0febf7..2bf38bd52c 100644 --- a/libkwineffects/kwinglutils.cpp +++ b/libkwineffects/kwinglutils.cpp @@ -1421,7 +1421,7 @@ void GLVertexBuffer::initStatic() #ifdef KWIN_HAVE_OPENGLES GLVertexBufferPrivate::supported = true; #else - GLVertexBufferPrivate::supported = hasGLExtension("GL_ARB_vertex_buffer_object"); + GLVertexBufferPrivate::supported = hasGLVersion(1, 5) || hasGLExtension("GL_ARB_vertex_buffer_object"); #endif GLVertexBufferPrivate::streamingBuffer = new GLVertexBuffer(GLVertexBuffer::Stream); } diff --git a/libkwineffects/kwinglutils_funcs.cpp b/libkwineffects/kwinglutils_funcs.cpp index e3f463b4c1..83b989e817 100644 --- a/libkwineffects/kwinglutils_funcs.cpp +++ b/libkwineffects/kwinglutils_funcs.cpp @@ -410,8 +410,14 @@ void glResolveFunctions(OpenGLPlatformInterface platformInterface) glProgramLocalParameter4fARB = NULL; glGetProgramivARB = NULL; } - if (hasGLExtension("GL_ARB_vertex_buffer_object")) { + + if (hasGLVersion(1, 5)) { // see http://www.opengl.org/registry/specs/ARB/vertex_buffer_object.txt + GL_RESOLVE(glGenBuffers); + GL_RESOLVE(glDeleteBuffers); + GL_RESOLVE(glBindBuffer); + GL_RESOLVE(glBufferData); + } else if (hasGLExtension("GL_ARB_vertex_buffer_object")) { GL_RESOLVE_WITH_EXT(glGenBuffers, glGenBuffersARB); GL_RESOLVE_WITH_EXT(glDeleteBuffers, glDeleteBuffersARB); GL_RESOLVE_WITH_EXT(glBindBuffer, glBindBufferARB);