summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2014-11-12 13:02:02 +0100
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2014-11-13 12:44:55 +0100
commitef828b89abb436d3ea97fc6d433450be75b41c4b (patch)
treeba2ce836a9e11b3dcf0bc4e62e7083b197786f62 /src/gui/opengl
parent302b6235eb7c4b6f63355483949f5915660d2c43 (diff)
QOpenGLTexture: revamp the feature list
OpenGL ES 3 adds lots of useful stuff in there, so we should start using it. Since we're there, properly reorganize the other feature checks. Note that by starting using immutable storage on GLES2, we may work around the issue reported in QTBUG-41822 (we're still not 100% sure if it's an ANGLE bug or a Qt bug). Task-number: QTBUG-41822 Change-Id: Id8cdbaaf93bc263e663db06b6fd2fee012cb29ad Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/gui/opengl')
-rw-r--r--src/gui/opengl/qopengltexture.cpp60
1 files changed, 48 insertions, 12 deletions
diff --git a/src/gui/opengl/qopengltexture.cpp b/src/gui/opengl/qopengltexture.cpp
index f6083b8cf9..9c30efe148 100644
--- a/src/gui/opengl/qopengltexture.cpp
+++ b/src/gui/opengl/qopengltexture.cpp
@@ -2826,7 +2826,8 @@ bool QOpenGLTexture::hasFeature(Feature feature)
case ImmutableStorage:
supported = f.version() >= qMakePair(4, 2)
- || ctx->hasExtension(QByteArrayLiteral("GL_ARB_texture_storage"));
+ || ctx->hasExtension(QByteArrayLiteral("GL_ARB_texture_storage"))
+ || ctx->hasExtension(QByteArrayLiteral("GL_EXT_texture_storage"));
break;
case TextureCubeMapArrays:
@@ -2873,9 +2874,6 @@ bool QOpenGLTexture::hasFeature(Feature feature)
case MaxFeatureFlag:
break;
-
- default:
- break;
}
}
@@ -2883,21 +2881,59 @@ bool QOpenGLTexture::hasFeature(Feature feature)
#endif
{
switch (feature) {
+ case ImmutableStorage:
+ supported = f.version() >= qMakePair(3, 0)
+ || ctx->hasExtension(QByteArrayLiteral("EXT_texture_storage"));
+ break;
+
+ case ImmutableMultisampleStorage:
+ supported = f.version() >= qMakePair(3, 1);
+ break;
+
+ case TextureRectangle:
+ break;
+
+ case TextureArrays:
+ supported = f.version() >= qMakePair(3, 0);
+ break;
+
case Texture3D:
- supported = ctx->hasExtension(QByteArrayLiteral("GL_OES_texture_3D"));
+ supported = f.version() >= qMakePair(3, 0)
+ || ctx->hasExtension(QByteArrayLiteral("GL_OES_texture_3D"));
+ break;
+
+ case TextureMultisample:
+ supported = f.version() >= qMakePair(3, 1);
+ break;
+
+ case TextureBuffer:
+ break;
+
+ case TextureCubeMapArrays:
+ break;
+
+ case Swizzle:
+ supported = f.version() >= qMakePair(3, 0);
+ break;
+
+ case StencilTexturing:
break;
+
case AnisotropicFiltering:
supported = ctx->hasExtension(QByteArrayLiteral("GL_EXT_texture_filter_anisotropic"));
break;
+
case NPOTTextures:
case NPOTTextureRepeat:
- supported = f.version() >= qMakePair(3,0);
- if (!supported) {
- supported = ctx->hasExtension(QByteArrayLiteral("GL_OES_texture_npot"));
- if (!supported)
- supported = ctx->hasExtension(QByteArrayLiteral("GL_ARB_texture_non_power_of_two"));
- }
- default:
+ supported = f.version() >= qMakePair(3,0)
+ || ctx->hasExtension(QByteArrayLiteral("GL_OES_texture_npot"))
+ || ctx->hasExtension(QByteArrayLiteral("GL_ARB_texture_non_power_of_two"));
+ break;
+
+ case Texture1D:
+ break;
+
+ case MaxFeatureFlag:
break;
}
}