diff --git a/src/Magnum/GL/Implementation/MeshState.cpp b/src/Magnum/GL/Implementation/MeshState.cpp index 6fecd4388..f9719984c 100644 --- a/src/Magnum/GL/Implementation/MeshState.cpp +++ b/src/Magnum/GL/Implementation/MeshState.cpp @@ -277,12 +277,18 @@ MeshState::MeshState(Context& context, ContextState& contextState, Containers::S 1 at all. */ #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) #ifndef MAGNUM_TARGET_WEBGL - if(context.isExtensionSupported()) { + /* The {EXT,OES}_draw_elements_base_vertex supports the multidraw + entrypoint only if EXT_multi_draw_arrays is supported as well. Which + is the case on Mesa, for example, but not on ANGLE -- there we have + to use the entrypoint from ANGLE_base_vertex_base_instance instead. */ + if(context.isExtensionSupported() && + context.isExtensionSupported()) { extensions[Extensions::EXT::draw_elements_base_vertex::Index] = Extensions::EXT::draw_elements_base_vertex::string(); multiDrawElementsBaseVertexImplementation = glMultiDrawElementsBaseVertexEXT; - } else if(context.isExtensionSupported()) { + } else if(context.isExtensionSupported() && + context.isExtensionSupported()) { extensions[Extensions::OES::draw_elements_base_vertex::Index] = Extensions::OES::draw_elements_base_vertex::string(); diff --git a/src/Magnum/GL/Test/MeshGLTest.cpp b/src/Magnum/GL/Test/MeshGLTest.cpp index 74a368104..6aad7fb98 100644 --- a/src/Magnum/GL/Test/MeshGLTest.cpp +++ b/src/Magnum/GL/Test/MeshGLTest.cpp @@ -4051,15 +4051,22 @@ template void MeshGLTest::multiDrawIndexed() { CORRADE_SKIP(Extensions::ARB::draw_elements_base_vertex::string() << "is not supported."); #elif !defined(MAGNUM_TARGET_WEBGL) #ifndef MAGNUM_TARGET_GLES2 - if(!Context::current().isExtensionSupported() && - !Context::current().isExtensionSupported() && - !Context::current().isExtensionSupported() + /* {OES,EXT}_draw_elements_base_vertex requires EXT_multi_draw_arrays + for the multi-draw entrypoint */ + if((!Context::current().isExtensionSupported() || ( + !Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported() + )) && + !Context::current().isExtensionSupported() ) CORRADE_SKIP("Neither" << Extensions::OES::draw_elements_base_vertex::string() << "nor" << Extensions::EXT::draw_elements_base_vertex::string() << "nor" << Extensions::ANGLE::base_vertex_base_instance::string() << "is supported."); #else - if(!Context::current().isExtensionSupported() && - !Context::current().isExtensionSupported() - ) + /* {OES,EXT}_draw_elements_base_vertex requires EXT_multi_draw_arrays + for the multi-draw entrypoint */ + if(!Context::current().isExtensionSupported() || ( + !Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported() + )) CORRADE_SKIP("Neither" << Extensions::OES::draw_elements_base_vertex::string() << "nor" << Extensions::EXT::draw_elements_base_vertex::string() << "is supported."); #endif #elif !defined(MAGNUM_TARGET_GLES2) @@ -4138,15 +4145,22 @@ template void MeshGLTest::multiDrawIndexedSparseArrays() { CORRADE_SKIP(Extensions::ARB::draw_elements_base_vertex::string() << "is not supported."); #elif !defined(MAGNUM_TARGET_WEBGL) #ifndef MAGNUM_TARGET_GLES2 - if(!Context::current().isExtensionSupported() && - !Context::current().isExtensionSupported() && - !Context::current().isExtensionSupported() + /* {OES,EXT}_draw_elements_base_vertex requires EXT_multi_draw_arrays + for the multi-draw entrypoint */ + if((!Context::current().isExtensionSupported() || ( + !Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported() + )) && + !Context::current().isExtensionSupported() ) CORRADE_SKIP("Neither" << Extensions::OES::draw_elements_base_vertex::string() << "nor" << Extensions::EXT::draw_elements_base_vertex::string() << "nor" << Extensions::ANGLE::base_vertex_base_instance::string() << "is supported."); #else - if(!Context::current().isExtensionSupported() && - !Context::current().isExtensionSupported() - ) + /* {OES,EXT}_draw_elements_base_vertex requires EXT_multi_draw_arrays + for the multi-draw entrypoint */ + if(!Context::current().isExtensionSupported() || ( + !Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported() + )) CORRADE_SKIP("Neither" << Extensions::OES::draw_elements_base_vertex::string() << "nor" << Extensions::EXT::draw_elements_base_vertex::string() << "is supported."); #endif #elif !defined(MAGNUM_TARGET_GLES2) @@ -4221,15 +4235,22 @@ void MeshGLTest::multiDrawIndexedViews() { CORRADE_SKIP(Extensions::ARB::draw_elements_base_vertex::string() << "is not supported."); #elif !defined(MAGNUM_TARGET_WEBGL) #ifndef MAGNUM_TARGET_GLES2 - if(!Context::current().isExtensionSupported() && - !Context::current().isExtensionSupported() && - !Context::current().isExtensionSupported() + /* {OES,EXT}_draw_elements_base_vertex requires EXT_multi_draw_arrays + for the multi-draw entrypoint */ + if((!Context::current().isExtensionSupported() || ( + !Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported() + )) && + !Context::current().isExtensionSupported() ) CORRADE_SKIP("Neither" << Extensions::OES::draw_elements_base_vertex::string() << "nor" << Extensions::EXT::draw_elements_base_vertex::string() << "nor" << Extensions::ANGLE::base_vertex_base_instance::string() << "is supported."); #else - if(!Context::current().isExtensionSupported() && - !Context::current().isExtensionSupported() - ) + /* {OES,EXT}_draw_elements_base_vertex requires EXT_multi_draw_arrays + for the multi-draw entrypoint */ + if(!Context::current().isExtensionSupported() || ( + !Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported() + )) CORRADE_SKIP("Neither" << Extensions::OES::draw_elements_base_vertex::string() << "nor" << Extensions::EXT::draw_elements_base_vertex::string() << "is supported."); #endif #elif !defined(MAGNUM_TARGET_GLES2)