[effects] Check for LimitedNPOT

Effects which require mipmaps need to check for LimitedNPOT and
disable the functionality if only limited NPOT is available.

Ideally the effects could also check whether the texture they
operate on is a power of two, but that's a little overkill for
the rather uncommon setup.

REVIEW: 126966
This commit is contained in:
Martin Gräßlin 2016-02-02 12:14:55 +01:00
parent ed3f55b953
commit bd5f642097
3 changed files with 4 additions and 3 deletions

View file

@ -443,7 +443,8 @@ void BlurEffect::drawWindow(EffectWindow *w, int mask, QRegion region, WindowPai
}
if (!shape.isEmpty()) {
if (w->isFullScreen() && GLRenderTarget::blitSupported() && m_simpleShader->isValid() && shape.boundingRect() == w->geometry()) {
if (w->isFullScreen() && GLRenderTarget::blitSupported() && m_simpleShader->isValid()
&& !GLPlatform::instance()->supports(LimitedNPOT) && shape.boundingRect() == w->geometry()) {
doSimpleBlur(w, data.opacity(), data.screenProjectionMatrix());
} else if (m_shouldCache && !translated && !w->isDeleted()) {
doCachedBlur(w, region, data.opacity(), data.screenProjectionMatrix());

View file

@ -117,7 +117,7 @@ void LogoutEffect::prePaintScreen(ScreenPrePaintData& data, int time)
} else if (!blurTexture) {
blurSupported = false;
delete blurTarget; // catch as we just tested the texture ;-P
if (effects->isOpenGLCompositing() && GLRenderTarget::blitSupported() && useBlur) {
if (effects->isOpenGLCompositing() && GLRenderTarget::blitSupported() && !GLPlatform::instance()->supports(LimitedNPOT) && useBlur) {
// TODO: It seems that it is not possible to create a GLRenderTarget that has
// a different size than the display right now. Most likely a KWin core bug.
// Create texture and render target

View file

@ -83,7 +83,7 @@ LookingGlassEffect::~LookingGlassEffect()
bool LookingGlassEffect::supported()
{
return effects->compositingType() == OpenGL2Compositing;
return effects->compositingType() == OpenGL2Compositing && !GLPlatform::instance()->supports(LimitedNPOT);
}
void LookingGlassEffect::reconfigure(ReconfigureFlags)