diff --git a/libkwineffects/kwinglplatform.cpp b/libkwineffects/kwinglplatform.cpp index b0d20f4545..3783a21273 100644 --- a/libkwineffects/kwinglplatform.cpp +++ b/libkwineffects/kwinglplatform.cpp @@ -602,6 +602,7 @@ void GLPlatform::detect(OpenGLPlatformInterface platformInterface) } m_chipset = "Unknown"; + m_preferBufferSubData = false; // Mesa classic drivers @@ -794,8 +795,10 @@ void GLPlatform::detect(OpenGLPlatformInterface platformInterface) if (m_driver == Driver_NVidia && m_chipClass < NV40) m_supportsGLSL = false; // High likelihood of software emulation - if (m_driver == Driver_NVidia) + if (m_driver == Driver_NVidia) { m_looseBinding = true; + m_preferBufferSubData = true; + } if (m_chipClass < NV20) { m_recommendedCompositor = XRenderCompositing; @@ -1051,6 +1054,11 @@ CompositingType GLPlatform::recommendedCompositor() const return m_recommendedCompositor; } +bool GLPlatform::preferBufferSubData() const +{ + return m_preferBufferSubData; +} + bool GLPlatform::isGLES() const { #ifdef KWIN_HAVE_OPENGLES diff --git a/libkwineffects/kwinglplatform.h b/libkwineffects/kwinglplatform.h index 55e23f6545..36a0e15e16 100644 --- a/libkwineffects/kwinglplatform.h +++ b/libkwineffects/kwinglplatform.h @@ -307,6 +307,14 @@ public: **/ CompositingType recommendedCompositor() const; + /** + * Returns true if glMapBufferRange() is likely to perform worse than glBufferSubData() + * when updating an unused range of a buffer object, and false otherwise. + * + * @since 4.11 + */ + bool preferBufferSubData() const; + /** * @returns a human readable form of the @p version. * @since 4.9 @@ -359,6 +367,7 @@ private: bool m_textureNPOT: 1; bool m_limitedNPOT: 1; bool m_virtualMachine: 1; + bool m_preferBufferSubData: 1; static GLPlatform *s_platform; };