diff --git a/src/Magnum/GL/Implementation/ContextState.cpp b/src/Magnum/GL/Implementation/ContextState.cpp index 78a834a17..0de455e75 100644 --- a/src/Magnum/GL/Implementation/ContextState.cpp +++ b/src/Magnum/GL/Implementation/ContextState.cpp @@ -28,21 +28,44 @@ #include #include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" namespace Magnum { namespace GL { namespace Implementation { using namespace Containers::Literals; -ContextState::ContextState(Context& context, Containers::StaticArrayView) { +ContextState::ContextState(Context& context, const Containers::StaticArrayView extensions) { #ifndef MAGNUM_TARGET_GLES if((context.detectedDriver() & Context::DetectedDriver::NVidia) && !context.isDriverWorkaroundDisabled("nv-zero-context-profile-mask"_s)) { isCoreProfileImplementation = &Context::isCoreProfileImplementationNV; } else isCoreProfileImplementation = &Context::isCoreProfileImplementationDefault; - #else + #endif + + #ifdef MAGNUM_TARGET_WEBGL + /* The rendererStringUnmasked() and vendorStringUnmasked() branch on the + extension on their own, which is in-line with all other "limit" queries. + It wouldn't make sense to create four new *Implementation() + functions and two new pointers for something that gets called mostly + just on application startup (and where it can't actually use the + function pointer because at that point the state is still yet to be + created). + + But since there's nothing else would add the extension to the used + extension list, we're doing that here. */ + if(context.isExtensionSupported()) { + extensions[Extensions::WEBGL::debug_renderer_info::Index] = + Extensions::WEBGL::debug_renderer_info::string(); + } + #endif + + #if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_WEBGL) static_cast(context); #endif + #ifndef MAGNUM_TARGET_WEBGL + static_cast(extensions); + #endif } }}}