From 8c4756a9e488ca796cbda886f215ecde4128f2a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 25 Nov 2015 11:21:05 +0100 Subject: [PATCH] Platform: use amd-nv-no-forward-compatible-core-context only when needed. Query its status only if we are really on that driver so it doesn't appear in the list of used workarounds. --- src/Magnum/Platform/Sdl2Application.cpp | 4 ++-- src/Magnum/Platform/WindowlessGlxApplication.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp index e8cbceda1..9216475e3 100644 --- a/src/Magnum/Platform/Sdl2Application.cpp +++ b/src/Magnum/Platform/Sdl2Application.cpp @@ -189,9 +189,9 @@ 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)) + std::strncmp(vendorString, amdVendorString, sizeof(amdVendorString)) == 0) + && !_context->isDriverWorkaroundDisabled("amd-nv-no-forward-compatible-core-context")) #endif )) { /* Don't print any warning when doing the NV workaround, because the diff --git a/src/Magnum/Platform/WindowlessGlxApplication.cpp b/src/Magnum/Platform/WindowlessGlxApplication.cpp index ab86937bd..ec2b64dc8 100644 --- a/src/Magnum/Platform/WindowlessGlxApplication.cpp +++ b/src/Magnum/Platform/WindowlessGlxApplication.cpp @@ -124,9 +124,9 @@ 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))) + std::strncmp(vendorString, amdVendorString, sizeof(amdVendorString)) == 0) && + !_context->isDriverWorkaroundDisabled("amd-nv-no-forward-compatible-core-context"))) #endif ) { /* Don't print any warning when doing the NV workaround, because the