From 04d294eda0ae10637ed3facae093dcb71e9d4c23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 12 Oct 2021 16:44:32 +0200 Subject: [PATCH] GL: disable requested extensions before setting up driver workarounds. This way it's possible to affect driver workarounds depending on certain extensions to be present. --- src/Magnum/GL/Context.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Magnum/GL/Context.cpp b/src/Magnum/GL/Context.cpp index df727ff6a..a9451905f 100644 --- a/src/Magnum/GL/Context.cpp +++ b/src/Magnum/GL/Context.cpp @@ -944,6 +944,11 @@ bool Context::tryCreate(const Configuration& configuration) { for(const Extension& extension: version.extensions) _extensionRequiredVersion[extension.index()] = extension.requiredVersion(); + /* Disable extensions as requested by the user. Do that before querying + any extension support, especially for driver workarounds. */ + for(const Extension& extension: _disabledExtensions) + _extensionRequiredVersion[extension.index()] = Version::None; + /* Setup driver workarounds (increase required version for particular extensions), see Implementation/driverWorkarounds.cpp */ setupDriverWorkarounds(); @@ -960,14 +965,11 @@ bool Context::tryCreate(const Configuration& configuration) { Debug{output} << "Renderer:" << rendererString().trimmed() << "by" << vendorString(); Debug{output} << "OpenGL version:" << versionString(); - /* Disable extensions as requested by the user */ + /* Print the extensions that were disabled above */ if(!_disabledExtensions.empty()) { Debug{output} << "Disabling extensions:"; - - for(const Extension& extension: _disabledExtensions) { - _extensionRequiredVersion[extension.index()] = Version::None; + for(const Extension& extension: _disabledExtensions) Debug{output} << " " << extension.string(); - } } std::pair state = Implementation::State::allocate(*this, output);