@ -716,9 +716,6 @@ GLPlatform::GLPlatform()
, m_chipClass ( UnknownChipClass )
, m_recommendedCompositor ( QPainterCompositing )
, m_looseBinding ( false )
, m_supportsGLSL ( false )
, m_textureNPOT ( false )
, m_limitedNPOT ( false )
, m_packInvert ( false )
, m_virtualMachine ( false )
, m_preferBufferSubData ( false )
@ -743,17 +740,6 @@ void GLPlatform::detect(OpenGLPlatformInterface platformInterface)
m_mesaVersion = Version : : parseString ( versionTokens . at ( mesaIndex + 1 ) ) ;
}
if ( isGLES ( ) ) {
m_supportsGLSL = true ;
m_textureNPOT = true ;
} else {
m_supportsGLSL = ( m_context - > hasOpenglExtension ( " GL_ARB_shader_objects " )
& & m_context - > hasOpenglExtension ( " GL_ARB_fragment_shader " )
& & m_context - > hasOpenglExtension ( " GL_ARB_vertex_shader " ) ) ;
m_textureNPOT = m_context - > hasOpenglExtension ( " GL_ARB_texture_non_power_of_two " ) ;
}
if ( ! qEnvironmentVariableIsSet ( " KWIN_NO_TIMER_QUERY " ) ) {
if ( isGLES ( ) ) {
// 3.0 is required so query functions can be used without "EXT" suffix.
@ -764,14 +750,8 @@ void GLPlatform::detect(OpenGLPlatformInterface platformInterface)
}
}
if ( m_supportsGLSL ) {
// Parse the GLSL version
m_glsl_version = ( const char * ) glGetString ( GL_SHADING_LANGUAGE_VERSION ) ;
m_glslVersion = Version : : parseString ( m_glsl_version ) ;
} else {
m_glsl_version . clear ( ) ;
m_glslVersion = Version ( 0 , 0 , 0 ) ;
}
m_glsl_version = ( const char * ) glGetString ( GL_SHADING_LANGUAGE_VERSION ) ;
m_glslVersion = Version : : parseString ( m_glsl_version ) ;
m_chipset = QByteArrayLiteral ( " Unknown " ) ;
m_preferBufferSubData = false ;
@ -956,22 +936,6 @@ void GLPlatform::detect(OpenGLPlatformInterface platformInterface)
// Driver/GPU specific features
// ====================================================
if ( isRadeon ( ) ) {
// R200 technically has a programmable pipeline, but since it's SM 1.4,
// it's too limited to to be of any practical value to us.
if ( m_chipClass < R300 ) {
m_supportsGLSL = false ;
}
m_limitedNPOT = false ;
if ( m_chipClass < R600 ) {
if ( driver ( ) = = Driver_Catalyst ) {
m_textureNPOT = m_limitedNPOT = false ; // Software fallback
} else if ( driver ( ) = = Driver_R300G ) {
m_limitedNPOT = m_textureNPOT ;
}
}
if ( m_chipClass < R300 ) {
// fallback to NoCompositing for R100 and R200
m_recommendedCompositor = NoCompositing ;
@ -988,10 +952,6 @@ void GLPlatform::detect(OpenGLPlatformInterface platformInterface)
}
if ( isNvidia ( ) ) {
if ( m_driver = = Driver_NVidia & & m_chipClass < NV40 ) {
m_supportsGLSL = false ; // High likelihood of software emulation
}
if ( m_driver = = Driver_NVidia ) {
m_looseBinding = true ;
m_preferBufferSubData = true ;
@ -1002,15 +962,9 @@ void GLPlatform::detect(OpenGLPlatformInterface platformInterface)
} else {
m_recommendedCompositor = OpenGLCompositing ;
}
m_limitedNPOT = m_textureNPOT & & m_chipClass < NV40 ;
}
if ( isIntel ( ) ) {
if ( m_chipClass < I915 ) {
m_supportsGLSL = false ;
}
// see https://bugs.freedesktop.org/show_bug.cgi?id=80349#c1
m_looseBinding = false ;
@ -1027,7 +981,6 @@ void GLPlatform::detect(OpenGLPlatformInterface platformInterface)
if ( isLima ( ) ) {
m_recommendedCompositor = OpenGLCompositing ;
m_supportsGLSL = true ;
}
if ( isVideoCore4 ( ) ) {
@ -1051,12 +1004,9 @@ void GLPlatform::detect(OpenGLPlatformInterface platformInterface)
if ( m_driver < Driver_Llvmpipe ) {
// we recommend QPainter
m_recommendedCompositor = QPainterCompositing ;
// Software emulation does not provide GLSL
m_supportsGLSL = false ;
} else {
// llvmpipe does support GLSL
m_recommendedCompositor = OpenGLCompositing ;
m_supportsGLSL = true ;
}
}
@ -1072,7 +1022,6 @@ void GLPlatform::detect(OpenGLPlatformInterface platformInterface)
if ( m_chipClass = = UnknownChipClass & & m_driver = = Driver_Unknown ) {
// we don't know the hardware. Let's be optimistic and assume OpenGL compatible hardware
m_recommendedCompositor = OpenGLCompositing ;
m_supportsGLSL = true ;
}
if ( isVirtualBox ( ) ) {
@ -1089,11 +1038,6 @@ void GLPlatform::detect(OpenGLPlatformInterface platformInterface)
m_virtualMachine = true ;
m_recommendedCompositor = OpenGLCompositing ;
}
// and force back to shader supported on gles, we wouldn't have got a context if not supported
if ( isGLES ( ) ) {
m_supportsGLSL = true ;
}
}
static void print ( const QByteArray & label , QByteArrayView setting )
@ -1106,33 +1050,18 @@ void GLPlatform::printResults() const
print ( QByteArrayLiteral ( " OpenGL vendor string: " ) , m_context - > vendor ( ) ) ;
print ( QByteArrayLiteral ( " OpenGL renderer string: " ) , m_context - > renderer ( ) ) ;
print ( QByteArrayLiteral ( " OpenGL version string: " ) , m_context - > openglVersionString ( ) ) ;
if ( m_supportsGLSL ) {
print ( QByteArrayLiteral ( " OpenGL shading language version string: " ) , m_glsl_version ) ;
}
print ( QByteArrayLiteral ( " OpenGL shading language version string: " ) , m_glsl_version ) ;
print ( QByteArrayLiteral ( " Driver: " ) , driverToString8 ( m_driver ) ) ;
if ( ! isMesaDriver ( ) ) {
print ( QByteArrayLiteral ( " Driver version: " ) , m_driverVersion . toByteArray ( ) ) ;
}
print ( QByteArrayLiteral ( " GPU class: " ) , chipClassToString8 ( m_chipClass ) ) ;
print ( QByteArrayLiteral ( " OpenGL version: " ) , m_context - > openglVersion ( ) . toByteArray ( ) ) ;
if ( m_supportsGLSL ) {
print ( QByteArrayLiteral ( " GLSL version: " ) , m_glslVersion . toByteArray ( ) ) ;
}
print ( QByteArrayLiteral ( " GLSL version: " ) , m_glslVersion . toByteArray ( ) ) ;
if ( isMesaDriver ( ) ) {
print ( QByteArrayLiteral ( " Mesa version: " ) , mesaVersion ( ) . toByteArray ( ) ) ;
}
// if (galliumVersion() > 0)
// print("Gallium version:", versionToString(m_galliumVersion));
print ( QByteArrayLiteral ( " Requires strict binding: " ) , ! m_looseBinding ? QByteArrayLiteral ( " yes " ) : QByteArrayLiteral ( " no " ) ) ;
print ( QByteArrayLiteral ( " GLSL shaders: " ) , m_supportsGLSL ? QByteArrayLiteral ( " yes " ) : QByteArrayLiteral ( " no " ) ) ;
print ( QByteArrayLiteral ( " Texture NPOT support: " ) , m_textureNPOT ? ( m_limitedNPOT ? QByteArrayLiteral ( " limited " ) : QByteArrayLiteral ( " yes " ) ) : QByteArrayLiteral ( " no " ) ) ;
print ( QByteArrayLiteral ( " Virtual Machine: " ) , m_virtualMachine ? QByteArrayLiteral ( " yes " ) : QByteArrayLiteral ( " no " ) ) ;
print ( QByteArrayLiteral ( " Timer query support: " ) , m_supportsTimerQuery ? QByteArrayLiteral ( " yes " ) : QByteArrayLiteral ( " no " ) ) ;
}
@ -1142,12 +1071,6 @@ bool GLPlatform::supports(GLFeature feature) const
switch ( feature ) {
case GLFeature : : LooseBinding :
return m_looseBinding ;
case GLFeature : : GLSL :
return m_supportsGLSL ;
case GLFeature : : TextureNPOT :
return m_textureNPOT ;
case GLFeature : : LimitedNPOT :
return m_limitedNPOT ;
case GLFeature : : PackInvert :
return m_packInvert ;
case GLFeature : : TimerQuery :