diff --git a/libkwineffects/kwinglplatform.cpp b/libkwineffects/kwinglplatform.cpp index a169efaa65..951fc6790a 100644 --- a/libkwineffects/kwinglplatform.cpp +++ b/libkwineffects/kwinglplatform.cpp @@ -632,9 +632,14 @@ void GLPlatform::detect() m_driver = Driver_Nouveau; } - else if (m_chipset == "softpipe" || m_chipset == "llvmpipe") { - // Vendor: VMware, Inc. - // TODO + // softpipe + else if (m_vendor == "VMware, Inc." && m_chipset == "softpipe" ) { + m_driver = Driver_Softpipe; + } + + // llvmpipe + else if (m_vendor == "VMware, Inc." && m_chipset == "llvmpipe") { + m_driver = Driver_Llvmpipe; } } @@ -712,6 +717,11 @@ void GLPlatform::detect() // Loose binding is broken with Gallium drivers in Mesa 7.10 if (isGalliumDriver() && mesaVersion() >= kVersionNumber(7, 10)) m_looseBinding = false; + + if (isSoftwareEmulation()) { + // Software emulation does not provide GLSL + m_limitedGLSL = m_supportsGLSL = false; + } } static void print(const QString &label, const QString &setting) @@ -851,6 +861,11 @@ bool GLPlatform::isIntel() const return m_chipClass >= I8XX && m_chipClass <= UnknownIntel; } +bool GLPlatform::isSoftwareEmulation() const +{ + return m_driver == Driver_Softpipe || m_driver == Driver_Swrast || m_driver == Driver_Llvmpipe; +} + } // namespace KWin #endif // KWIN_HAVE_OPENGL diff --git a/libkwineffects/kwinglplatform.h b/libkwineffects/kwinglplatform.h index fa2528d1b6..714dc43c3c 100644 --- a/libkwineffects/kwinglplatform.h +++ b/libkwineffects/kwinglplatform.h @@ -238,6 +238,12 @@ public: */ bool isIntel() const; + /** + * @returns @c true if OpenGL is emulated in software. + * @since 4.7 + **/ + bool isSoftwareEmulation() const; + private: GLPlatform(); diff --git a/scene_opengl_glx.cpp b/scene_opengl_glx.cpp index 221ba20fbe..edfff07cc9 100644 --- a/scene_opengl_glx.cpp +++ b/scene_opengl_glx.cpp @@ -61,7 +61,7 @@ SceneOpenGL::SceneOpenGL(Workspace* ws) // Initialize OpenGL initGL(); GLPlatform *glPlatform = GLPlatform::instance(); - if (glPlatform->driver() == Driver_Swrast || glPlatform->driver() == Driver_Softpipe) { + if (glPlatform->isSoftwareEmulation()) { kError(1212) << "OpenGL Software Rasterizer detected. Falling back to XRender."; QTimer::singleShot(0, Workspace::self(), SLOT(fallbackToXRenderCompositing())); return;