From a94aa904b0cce79b8ed36d84c1c51776607fe4cc Mon Sep 17 00:00:00 2001 From: Rivo Laks Date: Sun, 29 Apr 2007 15:39:33 +0000 Subject: [PATCH] Well, actually GLRenderTarget doesn't require NPOT textures (it works with rectangle textures as well). That also means that those effects which do require NPOT have to check for it themselves. svn path=/branches/work/kwin_composite/; revision=659155 --- effects/demo_liquid.cpp | 2 +- effects/test_fbo.cpp | 2 +- lib/kwinglutils.cpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/effects/demo_liquid.cpp b/effects/demo_liquid.cpp index 6b56332d85..8cd3110a5c 100644 --- a/effects/demo_liquid.cpp +++ b/effects/demo_liquid.cpp @@ -78,7 +78,7 @@ bool LiquidEffect::loadData() bool LiquidEffect::supported() { - return GLRenderTarget::supported() && + return GLRenderTarget::supported() && GLTexture::NPOTTextureSupported() && GLShader::fragmentShaderSupported() && (effects->compositingType() == OpenGLCompositing); } diff --git a/effects/test_fbo.cpp b/effects/test_fbo.cpp index b8aaea95f5..3c1e5ccef9 100644 --- a/effects/test_fbo.cpp +++ b/effects/test_fbo.cpp @@ -43,7 +43,7 @@ TestFBOEffect::~TestFBOEffect() bool TestFBOEffect::supported() { - return GLRenderTarget::supported() && + return GLRenderTarget::supported() && GLTexture::NPOTTextureSupported() && (effects->compositingType() == OpenGLCompositing); } diff --git a/lib/kwinglutils.cpp b/lib/kwinglutils.cpp index 3f855ba76f..8e4cef6061 100644 --- a/lib/kwinglutils.cpp +++ b/lib/kwinglutils.cpp @@ -720,8 +720,7 @@ bool GLRenderTarget::mSupported = false; void GLRenderTarget::initStatic() { - mSupported = hasGLExtension("GL_EXT_framebuffer_object") && glFramebufferTexture2D && - GLTexture::NPOTTextureSupported(); + mSupported = hasGLExtension("GL_EXT_framebuffer_object") && glFramebufferTexture2D; } GLRenderTarget::GLRenderTarget(GLTexture* color) @@ -781,7 +780,8 @@ void GLRenderTarget::initFBO() glGenFramebuffers(1, &mFramebuffer); glBindFramebuffer(GL_FRAMEBUFFER_EXT, mFramebuffer); - glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, mTexture->texture(), 0); + glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, + mTexture->target(), mTexture->texture(), 0); GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER_EXT); if(status != GL_FRAMEBUFFER_COMPLETE_EXT)