summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/renderers/opengl/textures/gltexture.cpp29
1 files changed, 23 insertions, 6 deletions
diff --git a/src/plugins/renderers/opengl/textures/gltexture.cpp b/src/plugins/renderers/opengl/textures/gltexture.cpp
index 804b20656..5b5e09582 100644
--- a/src/plugins/renderers/opengl/textures/gltexture.cpp
+++ b/src/plugins/renderers/opengl/textures/gltexture.cpp
@@ -94,7 +94,7 @@ void uploadGLData(QOpenGLTexture *glTex,
const QByteArray &bytes, const QTextureImageDataPtr &data)
{
if (data->isCompressed()) {
- qWarning() << Q_FUNC_INFO << "Uploading non full sized Compressed Data not supported yet";
+ Q_UNREACHABLE();
} else {
const auto alignment = data->alignment();
QOpenGLPixelTransferOptions uploadOptions;
@@ -602,11 +602,28 @@ void GLTexture::uploadGLTextureData()
// layer, face or mip level, unlike the QTextureGenerator case where
// they are in a single blob. Hence QTextureImageData::data() is not suitable.
- uploadGLData(m_gl,
- update.mipLevel(), update.layer(),
- static_cast<QOpenGLTexture::CubeMapFace>(update.face()),
- xOffset, yOffset, zOffset,
- bytes, imgData);
+ // Check if this is a full sized update
+ if (xOffset == 0 &&
+ yOffset == 0 &&
+ zOffset == 0 &&
+ xExtent == m_gl->width() &&
+ yExtent == m_gl->height() &&
+ zExtent == m_gl->depth()) {
+ uploadGLData(m_gl, update.mipLevel(), update.layer(),
+ static_cast<QOpenGLTexture::CubeMapFace>(update.face()),
+ bytes, imgData);
+ } else {
+ if (imgData->isCompressed()) {
+ qWarning() << Q_FUNC_INFO << "Uploading non full sized Compressed Data not supported yet";
+ } else {
+
+ uploadGLData(m_gl,
+ update.mipLevel(), update.layer(),
+ static_cast<QOpenGLTexture::CubeMapFace>(update.face()),
+ xOffset, yOffset, zOffset,
+ bytes, imgData);
+ }
+ }
}
}