diff --git a/src/Magnum/Implementation/driverSpecific.cpp b/src/Magnum/Implementation/driverSpecific.cpp index c7fed59e7..771f1688d 100644 --- a/src/Magnum/Implementation/driverSpecific.cpp +++ b/src/Magnum/Implementation/driverSpecific.cpp @@ -34,7 +34,12 @@ namespace Magnum { #ifndef CORRADE_NO_ASSERT namespace { - std::vector KnownWorkarounds{}; + std::vector KnownWorkarounds{ + /* Creating core context with specific version on AMD and NV + proprietary drivers causes the context to be forced to given + version instead of selecting latest available version */ + "amd-nv-no-forward-compatible-core-context" + }; } #endif diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp index 40f40ad58..e8cbceda1 100644 --- a/src/Magnum/Platform/Sdl2Application.cpp +++ b/src/Magnum/Platform/Sdl2Application.cpp @@ -189,6 +189,7 @@ bool Sdl2Application::tryCreateContext(const Configuration& configuration) { #ifndef CORRADE_TARGET_APPLE /* Sorry about the UGLY code, HOPEFULLY THERE WON'T BE MORE WORKAROUNDS */ || (vendorString = reinterpret_cast(glGetString(GL_VENDOR)), + !_context->isDriverWorkaroundDisabled("amd-nv-no-forward-compatible-core-context") && (std::strncmp(vendorString, nvidiaVendorString, sizeof(nvidiaVendorString)) == 0 || std::strncmp(vendorString, amdVendorString, sizeof(amdVendorString)) == 0)) #endif diff --git a/src/Magnum/Platform/WindowlessGlxApplication.cpp b/src/Magnum/Platform/WindowlessGlxApplication.cpp index 6fb8b8fd1..ab86937bd 100644 --- a/src/Magnum/Platform/WindowlessGlxApplication.cpp +++ b/src/Magnum/Platform/WindowlessGlxApplication.cpp @@ -124,6 +124,7 @@ bool WindowlessGlxApplication::tryCreateContext(const Configuration&) { and HOPEFULLY THERE WON'T BE MORE WORKAROUNDS */ || (glXMakeContextCurrent(_display, _pbuffer, _pbuffer, _glContext) && (vendorString = reinterpret_cast(glGetString(GL_VENDOR)), + !_context->isDriverWorkaroundDisabled("amd-nv-no-forward-compatible-core-context") && (std::strncmp(vendorString, nvidiaVendorString, sizeof(nvidiaVendorString)) == 0 || std::strncmp(vendorString, amdVendorString, sizeof(amdVendorString)) == 0))) #endif