Properly check for ability to use GL_REPEAT with npot textures
authorSean Harmer <sean.harmer.qnx@kdab.com>
Mon, 6 Aug 2012 10:04:35 +0000 (11:04 +0100)
committerQt by Nokia <qt-info@nokia.com>
Mon, 6 Aug 2012 22:02:15 +0000 (00:02 +0200)
Change-Id: I8dcc1c3f1d6959eef35a45f920bb37c08100a510
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
src/quick/scenegraph/qsgdefaultimagenode.cpp
src/quick/scenegraph/util/qsgtexturematerial.cpp

index 7da9ba4..fda4019 100644 (file)
@@ -411,7 +411,7 @@ void QSGDefaultImageNode::updateGeometry()
 
 #ifdef QT_OPENGL_ES_2
         QOpenGLContext *ctx = QOpenGLContext::currentContext();
-        bool npotSupported = ctx->functions()->hasOpenGLFeature(QOpenGLFunctions::NPOTTextures);
+        bool npotSupported = ctx->functions()->hasOpenGLFeature(QOpenGLFunctions::NPOTTextureRepeat);
         QSize size = t->textureSize();
         bool isNpot = !isPowerOfTwo(size.width()) || !isPowerOfTwo(size.height());
         bool wrapSupported = npotSupported || !isNpot;
index cdbef7d..e10514c 100644 (file)
@@ -103,7 +103,7 @@ void QSGOpaqueTextureMaterialShader::updateState(const RenderState &state, QSGMa
 
     t->setFiltering(tx->filtering());
 #ifdef QT_OPENGL_ES_2
-    bool npotSupported = QOpenGLFunctions(const_cast<QOpenGLContext *>(state.context())).hasOpenGLFeature(QOpenGLFunctions::NPOTTextures);
+    bool npotSupported = QOpenGLFunctions(const_cast<QOpenGLContext *>(state.context())).hasOpenGLFeature(QOpenGLFunctions::NPOTTextureRepeat);
     QSize size = t->textureSize();
     bool isNpot = !isPowerOfTwo(size.width()) || !isPowerOfTwo(size.height());
     if (!npotSupported && isNpot) {