From 5ce02c6811914a833c5756b4d20d5dadd1debff8 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Thu, 7 Sep 2023 13:55:00 +0200 Subject: [PATCH] libkwineffects: drop limited glsl detection It's not actually used anywhere --- autotests/libkwineffects/kwinglplatformtest.cpp | 2 -- src/libkwineffects/glplatform.cpp | 14 ++------------ src/libkwineffects/glplatform.h | 14 -------------- src/workspace.cpp | 10 +++------- 4 files changed, 5 insertions(+), 35 deletions(-) diff --git a/autotests/libkwineffects/kwinglplatformtest.cpp b/autotests/libkwineffects/kwinglplatformtest.cpp index 7c295ac761..6bc10fb51a 100644 --- a/autotests/libkwineffects/kwinglplatformtest.cpp +++ b/autotests/libkwineffects/kwinglplatformtest.cpp @@ -148,7 +148,6 @@ void GLPlatformTest::testPriorDetect() QVERIFY(gl); QCOMPARE(gl->supports(GLFeature::LooseBinding), false); QCOMPARE(gl->supports(GLFeature::GLSL), false); - QCOMPARE(gl->supports(GLFeature::LimitedGLSL), false); QCOMPARE(gl->supports(GLFeature::TextureNPOT), false); QCOMPARE(gl->supports(GLFeature::LimitedNPOT), false); @@ -250,7 +249,6 @@ void GLPlatformTest::testDetect() QCOMPARE(gl->supports(GLFeature::LooseBinding), settingsGroup.readEntry("LooseBinding", false)); QCOMPARE(gl->supports(GLFeature::GLSL), settingsGroup.readEntry("GLSL", false)); - QCOMPARE(gl->supports(GLFeature::LimitedGLSL), settingsGroup.readEntry("LimitedGLSL", false)); QCOMPARE(gl->supports(GLFeature::TextureNPOT), settingsGroup.readEntry("TextureNPOT", false)); QCOMPARE(gl->supports(GLFeature::LimitedNPOT), settingsGroup.readEntry("LimitedNPOT", false)); diff --git a/src/libkwineffects/glplatform.cpp b/src/libkwineffects/glplatform.cpp index 4432856c97..3f5499c3b1 100644 --- a/src/libkwineffects/glplatform.cpp +++ b/src/libkwineffects/glplatform.cpp @@ -755,7 +755,6 @@ GLPlatform::GLPlatform() , m_recommendedCompositor(QPainterCompositing) , m_looseBinding(false) , m_supportsGLSL(false) - , m_limitedGLSL(false) , m_textureNPOT(false) , m_limitedNPOT(false) , m_packInvert(false) @@ -1018,7 +1017,6 @@ void GLPlatform::detect(OpenGLPlatformInterface platformInterface) m_supportsGLSL = false; } - m_limitedGLSL = false; m_limitedNPOT = false; if (m_chipClass < R600) { @@ -1027,8 +1025,6 @@ void GLPlatform::detect(OpenGLPlatformInterface platformInterface) } else if (driver() == Driver_R300G) { m_limitedNPOT = m_textureNPOT; } - - m_limitedGLSL = m_supportsGLSL; } if (m_chipClass < R300) { @@ -1063,7 +1059,6 @@ void GLPlatform::detect(OpenGLPlatformInterface platformInterface) } m_limitedNPOT = m_textureNPOT && m_chipClass < NV40; - m_limitedGLSL = m_supportsGLSL && m_chipClass < G80; } if (isIntel()) { @@ -1071,7 +1066,6 @@ void GLPlatform::detect(OpenGLPlatformInterface platformInterface) m_supportsGLSL = false; } - m_limitedGLSL = m_supportsGLSL && m_chipClass < I965; // see https://bugs.freedesktop.org/show_bug.cgi?id=80349#c1 m_looseBinding = false; @@ -1113,11 +1107,10 @@ void GLPlatform::detect(OpenGLPlatformInterface platformInterface) // we recommend QPainter m_recommendedCompositor = QPainterCompositing; // Software emulation does not provide GLSL - m_limitedGLSL = m_supportsGLSL = false; + m_supportsGLSL = false; } else { // llvmpipe does support GLSL m_recommendedCompositor = OpenGLCompositing; - m_limitedGLSL = false; m_supportsGLSL = true; } } @@ -1155,7 +1148,6 @@ void GLPlatform::detect(OpenGLPlatformInterface platformInterface) // and force back to shader supported on gles, we wouldn't have got a context if not supported if (isGLES()) { m_supportsGLSL = true; - m_limitedGLSL = false; } } @@ -1200,7 +1192,7 @@ void GLPlatform::printResults() const } print(QByteArrayLiteral("Requires strict binding:"), !m_looseBinding ? QByteArrayLiteral("yes") : QByteArrayLiteral("no")); - print(QByteArrayLiteral("GLSL shaders:"), m_supportsGLSL ? (m_limitedGLSL ? QByteArrayLiteral("limited") : 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")); @@ -1213,8 +1205,6 @@ bool GLPlatform::supports(GLFeature feature) const return m_looseBinding; case GLFeature::GLSL: return m_supportsGLSL; - case GLFeature::LimitedGLSL: - return m_limitedGLSL; case GLFeature::TextureNPOT: return m_textureNPOT; case GLFeature::LimitedNPOT: diff --git a/src/libkwineffects/glplatform.h b/src/libkwineffects/glplatform.h index ee16d459e7..08725010ad 100644 --- a/src/libkwineffects/glplatform.h +++ b/src/libkwineffects/glplatform.h @@ -41,19 +41,6 @@ enum class GLFeature { */ GLSL, - /** - * If set, assume the following: - * - No flow control or branches - * - No loops, unless the loops have a fixed iteration count and can be unrolled - * - No functions, unless they can be inlined - * - No indirect indexing of arrays - * - No support for gl_ClipVertex or gl_FrontFacing - * - No texture fetches in vertex shaders - * - Max 32 texture fetches in fragment shaders - * - Max 4 texture indirections - */ - LimitedGLSL, - /** * Set when the driver supports GL_ARB_texture_non_power_of_two. */ @@ -480,7 +467,6 @@ private: Version m_kernelVersion; bool m_looseBinding : 1; bool m_supportsGLSL : 1; - bool m_limitedGLSL : 1; bool m_textureNPOT : 1; bool m_limitedNPOT : 1; bool m_packInvert : 1; diff --git a/src/workspace.cpp b/src/workspace.cpp index bc5122d42b..e162498221 100644 --- a/src/workspace.cpp +++ b/src/workspace.cpp @@ -1775,7 +1775,7 @@ QString Workspace::supportInformation() const } support.append(QStringLiteral("\n")); - if (platform->supports(GLFeature::LimitedGLSL) || platform->supports(GLFeature::GLSL)) { + if (platform->supports(GLFeature::GLSL)) { support.append(QStringLiteral("OpenGL shading language version string: ") + QString::fromUtf8(platform->glShadingLanguageVersionString()) + QStringLiteral("\n")); } @@ -1788,7 +1788,7 @@ QString Workspace::supportInformation() const support.append(QStringLiteral("OpenGL version: ") + GLPlatform::versionToString(platform->glVersion()) + QStringLiteral("\n")); - if (platform->supports(GLFeature::LimitedGLSL) || platform->supports(GLFeature::GLSL)) { + if (platform->supports(GLFeature::GLSL)) { support.append(QStringLiteral("GLSL version: ") + GLPlatform::versionToString(platform->glslVersion()) + QStringLiteral("\n")); } @@ -1811,11 +1811,7 @@ QString Workspace::supportInformation() const } support.append(QStringLiteral("GLSL shaders: ")); if (platform->supports(GLFeature::GLSL)) { - if (platform->supports(GLFeature::LimitedGLSL)) { - support.append(QStringLiteral(" limited\n")); - } else { - support.append(QStringLiteral(" yes\n")); - } + support.append(QStringLiteral(" yes\n")); } else { support.append(QStringLiteral(" no\n")); }