diff --git a/libkwineffects/kwingltexture.cpp b/libkwineffects/kwingltexture.cpp index 87664ada20..7187c6c050 100644 --- a/libkwineffects/kwingltexture.cpp +++ b/libkwineffects/kwingltexture.cpp @@ -190,7 +190,7 @@ GLTexture::GLTexture(const QString& fileName) { } -GLTexture::GLTexture(GLenum internalFormat, int width, int height, int levels) +GLTexture::GLTexture(GLenum internalFormat, int width, int height, int levels, bool needsMutability) : d_ptr(new GLTexturePrivate()) { Q_D(GLTexture); @@ -209,7 +209,7 @@ GLTexture::GLTexture(GLenum internalFormat, int width, int height, int levels) bind(); if (!GLPlatform::instance()->isGLES()) { - if (d->s_supportsTextureStorage) { + if (d->s_supportsTextureStorage && !needsMutability) { glTexStorage2D(d->m_target, levels, internalFormat, width, height); d->m_immutable = true; } else { @@ -234,8 +234,8 @@ GLTexture::GLTexture(GLenum internalFormat, int width, int height, int levels) unbind(); } -GLTexture::GLTexture(GLenum internalFormat, const QSize &size, int levels) - : GLTexture(internalFormat, size.width(), size.height(), levels) +GLTexture::GLTexture(GLenum internalFormat, const QSize &size, int levels, bool needsMutability) + : GLTexture(internalFormat, size.width(), size.height(), levels, needsMutability) { } diff --git a/libkwineffects/kwingltexture.h b/libkwineffects/kwingltexture.h index 4620362a6c..ccc390a517 100644 --- a/libkwineffects/kwingltexture.h +++ b/libkwineffects/kwingltexture.h @@ -57,8 +57,8 @@ public: explicit GLTexture(const QImage& image, GLenum target = GL_TEXTURE_2D); explicit GLTexture(const QPixmap& pixmap, GLenum target = GL_TEXTURE_2D); explicit GLTexture(const QString& fileName); - GLTexture(GLenum internalFormat, int width, int height, int levels = 1); - explicit GLTexture(GLenum internalFormat, const QSize &size, int levels = 1); + GLTexture(GLenum internalFormat, int width, int height, int levels = 1, bool needsMutability = false); + explicit GLTexture(GLenum internalFormat, const QSize &size, int levels = 1, bool needsMutability = false); /** * Create a GLTexture wrapper around an existing texture.