Fixed QOpenGLFunctions feature/extension detection to check GL version
If the GL version is new enough the extension string won't contain features that have been standardized. So far we only check for FBOs. Change-Id: Ib29826f378b394894885717c062872581bd5c9f5 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
This commit is contained in:
parent
3798b129c0
commit
d1acaf2b1c
@ -289,7 +289,7 @@ static int qt_gl_resolve_features()
|
||||
return features;
|
||||
#else
|
||||
int features = 0;
|
||||
//QOpenGLFormat::OpenGLVersionFlags versions = QOpenGLFormat::openGLVersionFlags();
|
||||
QSurfaceFormat format = QOpenGLContext::currentContext()->format();
|
||||
QOpenGLExtensionMatcher extensions;
|
||||
|
||||
// Recognize features by extension name.
|
||||
@ -327,6 +327,10 @@ static int qt_gl_resolve_features()
|
||||
QOpenGLFunctions::StencilSeparate |
|
||||
QOpenGLFunctions::BlendEquationSeparate |
|
||||
QOpenGLFunctions::NPOTTextures;
|
||||
|
||||
if (format.majorVersion() >= 3)
|
||||
features |= QOpenGLFunctions::Framebuffers;
|
||||
|
||||
return features;
|
||||
#endif
|
||||
}
|
||||
@ -349,10 +353,13 @@ static int qt_gl_resolve_extensions()
|
||||
extensions |= QOpenGLExtensions::BGRATextureFormat;
|
||||
|
||||
#else
|
||||
QSurfaceFormat format = QOpenGLContext::currentContext()->format();
|
||||
extensions |= QOpenGLExtensions::ElementIndexUint | QOpenGLExtensions::MapBuffer;
|
||||
|
||||
// Recognize features by extension name.
|
||||
if (extensionMatcher.match("GL_ARB_framebuffer_object")) {
|
||||
if (format.majorVersion() >= 3
|
||||
|| extensionMatcher.match("GL_ARB_framebuffer_object"))
|
||||
{
|
||||
extensions |= QOpenGLExtensions::FramebufferMultisample |
|
||||
QOpenGLExtensions::FramebufferBlit |
|
||||
QOpenGLExtensions::PackedDepthStencil;
|
||||
|
Loading…
x
Reference in New Issue
Block a user