diff --git a/libkwineffects/kwinglutils_funcs.cpp b/libkwineffects/kwinglutils_funcs.cpp index ce31749903..b299b814bd 100644 --- a/libkwineffects/kwinglutils_funcs.cpp +++ b/libkwineffects/kwinglutils_funcs.cpp @@ -198,6 +198,10 @@ glGetGraphicsResetStatus_func glGetGraphicsResetStatus; glReadnPixels_func glReadnPixels; glGetnUniformfv_func glGetnUniformfv; +// GL_ARB_draw_elements_base_vertex +glDrawElementsBaseVertex_func glDrawElementsBaseVertex; +glDrawElementsInstancedBaseVertex_func glDrawElementsInstancedBaseVertex; + static glXFuncPtr getProcAddress(const char* name) { @@ -695,6 +699,15 @@ void glResolveFunctions(OpenGLPlatformInterface platformInterface) glGetnUniformfv = KWin::GetnUniformfv; } + if (hasGLVersion(3, 2) || hasGLExtension("GL_ARB_draw_elements_base_vertex")) { + // See http://www.opengl.org/registry/specs/ARB/draw_elements_base_vertex.txt + GL_RESOLVE(glDrawElementsBaseVertex); + GL_RESOLVE(glDrawElementsInstancedBaseVertex); + } else { + glDrawElementsBaseVertex = NULL; + glDrawElementsInstancedBaseVertex = NULL; + } + #else if (hasGLExtension("GL_OES_mapbuffer")) { diff --git a/libkwineffects/kwinglutils_funcs.h b/libkwineffects/kwinglutils_funcs.h index d6a2cd1cef..faed015130 100644 --- a/libkwineffects/kwinglutils_funcs.h +++ b/libkwineffects/kwinglutils_funcs.h @@ -453,6 +453,13 @@ extern KWIN_EXPORT glGetGraphicsResetStatus_func glGetGraphicsResetStatus; extern KWIN_EXPORT glReadnPixels_func glReadnPixels; extern KWIN_EXPORT glGetnUniformfv_func glGetnUniformfv; +// GL_ARB_draw_elements_base_vertex +typedef void (*glDrawElementsBaseVertex_func)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); +typedef void (*glDrawElementsInstancedBaseVertex_func)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount, GLint basevertex); + +extern KWIN_EXPORT glDrawElementsBaseVertex_func glDrawElementsBaseVertex; +extern KWIN_EXPORT glDrawElementsInstancedBaseVertex_func glDrawElementsInstancedBaseVertex; + } // namespace #endif // not KWIN_HAVE_OPENGLES