diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-08-06 12:03:06 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-08-08 22:52:31 +0000 |
commit | 87666d391cb7d9cca520718bf86f5b514ae681cc (patch) | |
tree | 547845ad227587001a3e84f3150dddb9ff96956d /src/gui/opengl/qopengltexture_p.h | |
parent | 9861d2bf1446dbbe0f59694db6c7eed44e5e4a13 (diff) |
Make compressed textures work with mutable storage
1. glTexImage*D does not accept compressed formats.
2. Replacing it with glCompressedTexImage*D is not an option as per GLES 2.0 spec
since passing null data is not allowed.
3. glCompressedTexSubImage*D must always be preceded by a glCompressedTexImage*d
(or glTexStorage*D) call.
4. Therefore the only way is to do nothing in allocateStorage() and switch to
glCompressedTexImage*D in setCompressedData() whenever mutable storage is in use.
This makes ETC1 textures working on the Beaglebone (and presumably others).
Change-Id: I21a040f6ed4aecaa494b6e5a6c6cd75b7389c15c
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/gui/opengl/qopengltexture_p.h')
-rw-r--r-- | src/gui/opengl/qopengltexture_p.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/opengl/qopengltexture_p.h b/src/gui/opengl/qopengltexture_p.h index be4bf0e93c..ac9d44db42 100644 --- a/src/gui/opengl/qopengltexture_p.h +++ b/src/gui/opengl/qopengltexture_p.h @@ -117,6 +117,8 @@ public: return std::floor(double(qMax(1, baseLevelSize >> mipLevel))); } + bool isUsingImmutableStorage() const; + QOpenGLTexture *q_ptr; QOpenGLContext *context; QOpenGLTexture::Target target; |