From 0541516907da117c391b6c8d9820209673fcd9cd Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 2 Jul 2014 16:33:15 +0200 Subject: Use the standard functions in GLES3 builds in VAOs There is no guarantee that the OES extension is present and the standard functions are not required to be dynamically resolvable on ES. By performing the ARB-style lookup for the suffixless function names we can also support ES3 compatible contexts on desktop GL. This also fixes the problem of picking up the APPLE extension functions instead of ARB when both are available. vaoFuncsType was set to ARB correctly but the helper has to take the preference of ARB into account too. Task-number: QTBUG-38168 Change-Id: If7402320e8f96891017674f3c43bc57c4b5d29f3 Reviewed-by: Sean Harmer --- tests/auto/gui/qopengl/tst_qopengl.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'tests/auto/gui/qopengl/tst_qopengl.cpp') diff --git a/tests/auto/gui/qopengl/tst_qopengl.cpp b/tests/auto/gui/qopengl/tst_qopengl.cpp index c32edd3f71..7de1989ada 100644 --- a/tests/auto/gui/qopengl/tst_qopengl.cpp +++ b/tests/auto/gui/qopengl/tst_qopengl.cpp @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -96,6 +97,8 @@ private slots: #ifdef USE_GLX void glxContextWrap(); #endif + + void vaoCreate(); }; struct SharedResourceTracker @@ -1020,6 +1023,27 @@ void tst_QOpenGL::glxContextWrap() } #endif // USE_GLX +void tst_QOpenGL::vaoCreate() +{ + QScopedPointer surface(createSurface(QSurface::Window)); + QOpenGLContext *ctx = new QOpenGLContext; + ctx->create(); + ctx->makeCurrent(surface.data()); + + QOpenGLVertexArrayObject vao; + bool success = vao.create(); + if (ctx->isOpenGLES()) { + if (ctx->format().majorVersion() >= 3 || ctx->hasExtension(QByteArrayLiteral("GL_OES_vertex_array_object"))) + QVERIFY(success); + } else { + if (ctx->format().majorVersion() >= 3 || ctx->hasExtension(QByteArrayLiteral("GL_ARB_vertex_array_object"))) + QVERIFY(success); + } + + vao.destroy(); + ctx->doneCurrent(); +} + QTEST_MAIN(tst_QOpenGL) #include "tst_qopengl.moc" -- cgit v1.2.3