diff --git a/src/opengl/glframebuffer.cpp b/src/opengl/glframebuffer.cpp index 2f03c6c120..56a5f7a233 100644 --- a/src/opengl/glframebuffer.cpp +++ b/src/opengl/glframebuffer.cpp @@ -22,12 +22,10 @@ namespace KWin void GLFramebuffer::initStatic() { if (GLPlatform::instance()->isGLES()) { - s_supported = true; s_supportsPackedDepthStencil = hasGLVersion(3, 0) || hasGLExtension(QByteArrayLiteral("GL_OES_packed_depth_stencil")); s_supportsDepth24 = hasGLVersion(3, 0) || hasGLExtension(QByteArrayLiteral("GL_OES_depth24")); s_blitSupported = hasGLVersion(3, 0); } else { - s_supported = hasGLVersion(3, 0) || hasGLExtension(QByteArrayLiteral("GL_ARB_framebuffer_object")) || hasGLExtension(QByteArrayLiteral("GL_EXT_framebuffer_object")); s_supportsPackedDepthStencil = hasGLVersion(3, 0) || hasGLExtension(QByteArrayLiteral("GL_ARB_framebuffer_object")) || hasGLExtension(QByteArrayLiteral("GL_EXT_packed_depth_stencil")); s_blitSupported = hasGLVersion(3, 0) || hasGLExtension(QByteArrayLiteral("GL_ARB_framebuffer_object")) || hasGLExtension(QByteArrayLiteral("GL_EXT_framebuffer_blit")); } @@ -36,7 +34,6 @@ void GLFramebuffer::initStatic() void GLFramebuffer::cleanup() { Q_ASSERT(s_fbos.isEmpty()); - s_supported = false; s_blitSupported = false; } @@ -109,11 +106,6 @@ GLFramebuffer::GLFramebuffer(GLTexture *colorAttachment, Attachment attachment) : m_size(colorAttachment->size()) , m_colorAttachment(colorAttachment) { - if (!s_supported) { - qCCritical(KWIN_OPENGL) << "Framebuffer objects aren't supported!"; - return; - } - GLuint prevFbo = 0; if (const GLFramebuffer *current = currentFramebuffer()) { prevFbo = current->handle(); diff --git a/src/opengl/glframebuffer.h b/src/opengl/glframebuffer.h index 98d1d4fb7b..b3ea4ef9c1 100644 --- a/src/opengl/glframebuffer.h +++ b/src/opengl/glframebuffer.h @@ -82,10 +82,6 @@ public: } static void initStatic(); - static bool supported() - { - return s_supported; - } /** * Returns the last bound framebuffer, or @c null if no framebuffer is current. @@ -138,7 +134,6 @@ private: friend void KWin::cleanupGL(); static void cleanup(); - inline static bool s_supported = false; inline static bool s_supportsPackedDepthStencil = false; inline static bool s_supportsDepth24 = false; inline static bool s_blitSupported = false; diff --git a/src/opengl/gltexture.cpp b/src/opengl/gltexture.cpp index dcd587acab..468a402dd0 100644 --- a/src/opengl/gltexture.cpp +++ b/src/opengl/gltexture.cpp @@ -29,7 +29,6 @@ namespace KWin // GLTexture //**************************************** -bool GLTexturePrivate::s_supportsFramebufferObjects = false; bool GLTexturePrivate::s_supportsARGB32 = false; bool GLTexturePrivate::s_supportsUnpack = false; bool GLTexturePrivate::s_supportsTextureStorage = false; @@ -144,7 +143,6 @@ GLTexturePrivate::~GLTexturePrivate() void GLTexturePrivate::initStatic() { if (!GLPlatform::instance()->isGLES()) { - s_supportsFramebufferObjects = hasGLVersion(3, 0) || hasGLExtension("GL_ARB_framebuffer_object") || hasGLExtension(QByteArrayLiteral("GL_EXT_framebuffer_object")); s_supportsTextureStorage = hasGLVersion(4, 2) || hasGLExtension(QByteArrayLiteral("GL_ARB_texture_storage")); s_supportsTextureSwizzle = hasGLVersion(3, 3) || hasGLExtension(QByteArrayLiteral("GL_ARB_texture_swizzle")); // see https://www.opengl.org/registry/specs/ARB/texture_rg.txt @@ -153,7 +151,6 @@ void GLTexturePrivate::initStatic() s_supportsARGB32 = true; s_supportsUnpack = true; } else { - s_supportsFramebufferObjects = true; s_supportsTextureStorage = hasGLVersion(3, 0) || hasGLExtension(QByteArrayLiteral("GL_EXT_texture_storage")); s_supportsTextureSwizzle = hasGLVersion(3, 0); // see https://www.khronos.org/registry/gles/extensions/EXT/EXT_texture_rg.txt @@ -170,7 +167,6 @@ void GLTexturePrivate::initStatic() void GLTexturePrivate::cleanup() { - s_supportsFramebufferObjects = false; s_supportsARGB32 = false; if (s_fbo) { glDeleteFramebuffers(1, &s_fbo); @@ -321,7 +317,7 @@ void GLTexture::bind() void GLTexture::generateMipmaps() { - if (d->m_canUseMipmaps && d->s_supportsFramebufferObjects) { + if (d->m_canUseMipmaps) { glGenerateMipmap(d->m_target); } } @@ -423,7 +419,7 @@ GLenum GLTexture::internalFormat() const void GLTexture::clear() { Q_ASSERT(d->m_owning); - if (!GLTexturePrivate::s_fbo && GLFramebuffer::supported() && GLPlatform::instance()->driver() != Driver_Catalyst) { // fail. -> bug #323065 + if (!GLTexturePrivate::s_fbo && GLPlatform::instance()->driver() != Driver_Catalyst) { // fail. -> bug #323065 glGenFramebuffers(1, &GLTexturePrivate::s_fbo); } @@ -553,11 +549,6 @@ QMatrix4x4 GLTexture::matrix(TextureCoordinateType type) const return d->m_matrix[type]; } -bool GLTexture::framebufferObjectSupported() -{ - return GLTexturePrivate::s_supportsFramebufferObjects; -} - bool GLTexture::supportsSwizzle() { return GLTexturePrivate::s_supportsTextureSwizzle; diff --git a/src/opengl/gltexture.h b/src/opengl/gltexture.h index ef6baa2e69..1e30a29ccd 100644 --- a/src/opengl/gltexture.h +++ b/src/opengl/gltexture.h @@ -112,8 +112,6 @@ public: void generateMipmaps(); - static bool framebufferObjectSupported(); - /** * Returns true if texture swizzle is supported, and false otherwise * diff --git a/src/opengl/gltexture_p.h b/src/opengl/gltexture_p.h index 2b5fd8cdde..37defc5b54 100644 --- a/src/opengl/gltexture_p.h +++ b/src/opengl/gltexture_p.h @@ -58,7 +58,6 @@ public: static void initStatic(); - static bool s_supportsFramebufferObjects; static bool s_supportsARGB32; static bool s_supportsUnpack; static bool s_supportsTextureStorage; diff --git a/src/opengl/openglcontext.cpp b/src/opengl/openglcontext.cpp index 394d750e26..7bf4149e4d 100644 --- a/src/opengl/openglcontext.cpp +++ b/src/opengl/openglcontext.cpp @@ -119,7 +119,8 @@ bool OpenGlContext::checkSupported() const const bool supportsGLSL = m_isOpenglES || (hasOpenglExtension("GL_ARB_shader_objects") && hasOpenglExtension("GL_ARB_fragment_shader") && hasOpenglExtension("GL_ARB_vertex_shader")); const bool supportsNonPowerOfTwoTextures = m_isOpenglES || hasOpenglExtension("GL_ARB_texture_non_power_of_two"); const bool supports3DTextures = !m_isOpenglES || hasVersion(Version(3, 0)) || hasOpenglExtension("GL_OES_texture_3D"); - return supportsGLSL && supportsNonPowerOfTwoTextures && supports3DTextures; + const bool supportsFBOs = m_isOpenglES || hasVersion(Version(3, 0)) || hasOpenglExtension("GL_ARB_framebuffer_object") || hasOpenglExtension(QByteArrayLiteral("GL_EXT_framebuffer_object")); + return supportsGLSL && supportsNonPowerOfTwoTextures && supports3DTextures && supportsFBOs; } void OpenGlContext::setShaderManager(ShaderManager *manager) diff --git a/src/plugins/backgroundcontrast/contrast.cpp b/src/plugins/backgroundcontrast/contrast.cpp index fff7389dea..7cc83c0d14 100644 --- a/src/plugins/backgroundcontrast/contrast.cpp +++ b/src/plugins/backgroundcontrast/contrast.cpp @@ -297,7 +297,7 @@ bool ContrastEffect::enabledByDefault() bool ContrastEffect::supported() { - bool supported = effects->isOpenGLCompositing() && GLFramebuffer::supported(); + bool supported = effects->isOpenGLCompositing(); if (supported) { int maxTexSize; diff --git a/src/plugins/blur/blur.cpp b/src/plugins/blur/blur.cpp index f69f1b4eca..b3fea96723 100644 --- a/src/plugins/blur/blur.cpp +++ b/src/plugins/blur/blur.cpp @@ -371,7 +371,7 @@ bool BlurEffect::enabledByDefault() bool BlurEffect::supported() { - return effects->isOpenGLCompositing() && GLFramebuffer::supported() && GLFramebuffer::blitSupported(); + return effects->isOpenGLCompositing() && GLFramebuffer::blitSupported(); } bool BlurEffect::decorationSupportsBlurBehind(const EffectWindow *w) const diff --git a/src/plugins/screenshot/screenshot.cpp b/src/plugins/screenshot/screenshot.cpp index 54b27d7993..5cdb4791f5 100644 --- a/src/plugins/screenshot/screenshot.cpp +++ b/src/plugins/screenshot/screenshot.cpp @@ -85,7 +85,7 @@ static void convertFromGLImage(QImage &img, int w, int h, const OutputTransform bool ScreenShotEffect::supported() { - return effects->isOpenGLCompositing() && GLFramebuffer::supported(); + return effects->isOpenGLCompositing(); } ScreenShotEffect::ScreenShotEffect()