Commit 14782f22 authored by Martin Flöser's avatar Martin Flöser
Browse files

Improved detection of OpenGL software emulation

Adding a new method to retrieve whether the OpenGL implementation
uses any kind of software emulation and no software emulation can
provide GLSL support, even if it claims so.

Thanks to Maurel for testing again and again proposed patches.

BUG: 271166
parent d6a3ce06
......@@ -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
......
......@@ -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();
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment