From 6c5955e58f885cf5b4597b8fb0a059d204e2a5e1 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Thu, 1 Mar 2012 12:34:48 +0100 Subject: [PATCH] Set bind options before uploading to give hints to the driver This can prevent allocation of unused mipmap levels on some drivers. Change-Id: I2d730c04e120872367078b17a344c01b4d4aa87a Reviewed-by: Kim M. Kalland --- src/quick/scenegraph/util/qsgtexture.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/quick/scenegraph/util/qsgtexture.cpp b/src/quick/scenegraph/util/qsgtexture.cpp index 7ccedc4..4dff1b2 100644 --- a/src/quick/scenegraph/util/qsgtexture.cpp +++ b/src/quick/scenegraph/util/qsgtexture.cpp @@ -496,6 +496,8 @@ void QSGPlainTexture::bind() ? m_image : m_image.convertToFormat(QImage::Format_ARGB32_Premultiplied); + updateBindOptions(m_dirty_bind_options); + #ifdef QT_OPENGL_ES swizzleBGRAToRGBA(&tmp); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, tmp.constBits()); @@ -512,7 +514,6 @@ void QSGPlainTexture::bind() m_texture_size = QSize(w, h); m_texture_rect = QRectF(0, 0, 1, 1); - updateBindOptions(m_dirty_bind_options); m_dirty_bind_options = false; } -- 2.7.4