QOpenGLTexture: fix the feature test for Buffer Textures

1a4ff6f122 modified the features test
by checking extensions as well as the GL version. The problem was that
the GL version was wrong in the first place -- buffer textures are
natively supported since OpenGL 3.0, not 4.3.

4.3 introduced support for buffer texture ranges, i.e.
ARB_texture_buffer_range; however it's pointless to take the highest
requirement, especially considering that so far QOpenGLTexture doesn't
wrap glTexBuffer(Range) in any way. In the future, if QOpenGLTexture
will also wrap glTexBuffer, then we will also be able to introduce
a different feature flag for testing buffer texture ranges.

Change-Id: I6becbd49ac26d44ce01d088cbb7831b5cc127bdb
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
This commit is contained in:
Giuseppe D'Angelo 2014-07-01 20:57:42 +02:00
parent 9ee27005ee
commit 9e5765fba0

View File

@ -2446,9 +2446,8 @@ bool QOpenGLTexture::hasFeature(Feature feature)
break;
case TextureBuffer:
supported = f.version() >= qMakePair(4, 3)
|| (ctx->hasExtension(QByteArrayLiteral("GL_ARB_texture_buffer_object"))
&& ctx->hasExtension(QByteArrayLiteral("GL_ARB_texture_buffer_range")));
supported = f.version() >= qMakePair(3, 0)
|| ctx->hasExtension(QByteArrayLiteral("GL_ARB_texture_buffer_object"));
break;
case StencilTexturing: