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
icc-effect-5.14.5
Martin Gräßlin 2011-05-06 18:13:54 +02:00
parent 57c2b33bce
commit 1dd614ee4b
3 changed files with 25 additions and 4 deletions

View File

@ -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

View File

@ -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();

View File

@ -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;