aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@nokia.com>2012-03-01 12:34:48 +0100
committerQt by Nokia <qt-info@nokia.com>2012-03-01 13:26:10 +0100
commit6c5955e58f885cf5b4597b8fb0a059d204e2a5e1 (patch)
tree9fbe60bd78436ca72004d469972420c6f1341fad
parentc0da7869001a52668f4ffaa851e05dd0ca6e6d67 (diff)
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 <kim.kalland@nokia.com>
-rw-r--r--src/quick/scenegraph/util/qsgtexture.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/quick/scenegraph/util/qsgtexture.cpp b/src/quick/scenegraph/util/qsgtexture.cpp
index 7ccedc4c48..4dff1b2a3d 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;
}