diff --git a/src/Magnum/Implementation/driverSpecific.cpp b/src/Magnum/Implementation/driverSpecific.cpp index e6840aeda..b405dc12d 100644 --- a/src/Magnum/Implementation/driverSpecific.cpp +++ b/src/Magnum/Implementation/driverSpecific.cpp @@ -35,10 +35,13 @@ namespace Magnum { namespace { std::vector KnownWorkarounds{ #ifndef MAGNUM_TARGET_GLES + #ifndef CORRADE_TARGET_APPLE /* 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", + proprietary drivers on Linux/Windows and Intel drivers on Windows + causes the context to be forced to given version instead of + selecting latest available version */ + "no-forward-compatible-core-context", + #endif #ifdef CORRADE_TARGET_WINDOWS /* On Windows Intel drivers ARB_shading_language_420pack is exposed in diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp index 7578fdbdd..ce86b4909 100644 --- a/src/Magnum/Platform/Sdl2Application.cpp +++ b/src/Magnum/Platform/Sdl2Application.cpp @@ -186,6 +186,9 @@ bool Sdl2Application::tryCreateContext(const Configuration& configuration) { version to the one specified, which is completely useless behavior. */ #ifndef CORRADE_TARGET_APPLE constexpr static const char nvidiaVendorString[] = "NVIDIA Corporation"; + #ifdef CORRADE_TARGET_WINDOWS + constexpr static const char intelVendorString[] = "Intel"; + #endif constexpr static const char amdVendorString[] = "ATI Technologies Inc."; const char* vendorString; #endif @@ -194,8 +197,11 @@ bool Sdl2Application::tryCreateContext(const Configuration& configuration) { /* Sorry about the UGLY code, HOPEFULLY THERE WON'T BE MORE WORKAROUNDS */ || (vendorString = reinterpret_cast(glGetString(GL_VENDOR)), (std::strncmp(vendorString, nvidiaVendorString, sizeof(nvidiaVendorString)) == 0 || + #ifdef CORRADE_TARGET_WINDOWS + std::strncmp(vendorString, intelVendorString, sizeof(intelVendorString)) == 0 || + #endif std::strncmp(vendorString, amdVendorString, sizeof(amdVendorString)) == 0) - && !_context->isDriverWorkaroundDisabled("amd-nv-no-forward-compatible-core-context")) + && !_context->isDriverWorkaroundDisabled("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 fcb693f7e..b9f014a0b 100644 --- a/src/Magnum/Platform/WindowlessGlxApplication.cpp +++ b/src/Magnum/Platform/WindowlessGlxApplication.cpp @@ -103,9 +103,9 @@ WindowlessGlxContext::WindowlessGlxContext(const WindowlessGlxContext::Configura _context = glXCreateContextAttribsARB(_display, configs[0], nullptr, True, fallbackContextAttributes); /* Fall back to (forward compatible) GL 2.1 if we are on binary NVidia/AMD - drivers on Linux/Windows. Instead of creating forward-compatible context - with highest available version, they force the version to the one - specified, which is completely useless behavior. */ + drivers on Linux. Instead of creating forward-compatible context with + highest available version, they force the version to the one specified, + which is completely useless behavior. */ } else { /* We need to make the context current to read out vendor string, so save the previous values so we can safely revert back without @@ -125,7 +125,7 @@ WindowlessGlxContext::WindowlessGlxContext(const WindowlessGlxContext::Configura const char* const vendorString = reinterpret_cast(glGetString(GL_VENDOR)); if((std::strncmp(vendorString, nvidiaVendorString, sizeof(nvidiaVendorString)) == 0 || std::strncmp(vendorString, amdVendorString, sizeof(amdVendorString)) == 0) && - (!magnumContext || !magnumContext->isDriverWorkaroundDisabled("amd-nv-no-forward-compatible-core-context"))) + (!magnumContext || !magnumContext->isDriverWorkaroundDisabled("no-forward-compatible-core-context"))) { /* Destroy the core context and create a compatibility one */ glXDestroyContext(_display, _context); diff --git a/src/Magnum/Platform/WindowlessWglApplication.cpp b/src/Magnum/Platform/WindowlessWglApplication.cpp index 75845496e..8e4be0878 100644 --- a/src/Magnum/Platform/WindowlessWglApplication.cpp +++ b/src/Magnum/Platform/WindowlessWglApplication.cpp @@ -138,10 +138,10 @@ WindowlessWglContext::WindowlessWglContext(const Configuration& configuration, C }; _context = wglCreateContextAttribsARB(_deviceContext, nullptr, fallbackContextAttributes); - /* Fall back to (forward compatible) GL 2.1 if we are on binary NVidia/AMD - drivers on Linux/Windows. Instead of creating forward-compatible context - with highest available version, they force the version to the one - specified, which is completely useless behavior. */ + /* Fall back to (forward compatible) GL 2.1 if we are on binary + NVidia/AMD/Intel drivers on Windows. Instead of creating forward-compatible + context with highest available version, they force the version to the + one specified, which is completely useless behavior. */ } else { /* We need to make the context current to read out vendor string */ if(!wglMakeCurrent(_deviceContext, _context)) { @@ -157,11 +157,13 @@ WindowlessWglContext::WindowlessWglContext(const Configuration& configuration, C /* The workaround check is the last so it doesn't appear in workaround list on unrelated drivers */ constexpr static const char nvidiaVendorString[] = "NVIDIA Corporation"; + constexpr static const char intelVendorString[] = "Intel"; constexpr static const char amdVendorString[] = "ATI Technologies Inc."; const char* const vendorString = reinterpret_cast(glGetString(GL_VENDOR)); if((std::strncmp(vendorString, nvidiaVendorString, sizeof(nvidiaVendorString)) == 0 || + std::strncmp(vendorString, intelVendorString, sizeof(intelVendorString)) == 0 || std::strncmp(vendorString, amdVendorString, sizeof(amdVendorString)) == 0) && - (!magnumContext || !magnumContext->isDriverWorkaroundDisabled("amd-nv-no-forward-compatible-core-context"))) + (!magnumContext || !magnumContext->isDriverWorkaroundDisabled("no-forward-compatible-core-context"))) { /* Destroy the core context and create a compatibility one */ wglDeleteContext(_context); diff --git a/src/Magnum/Platform/magnum-info.cpp b/src/Magnum/Platform/magnum-info.cpp index a7bc1a027..c6efab471 100644 --- a/src/Magnum/Platform/magnum-info.cpp +++ b/src/Magnum/Platform/magnum-info.cpp @@ -115,7 +115,7 @@ Using optional features: GL_ARB_invalidate_subdata ... Using driver workarounds: - amd-nv-no-forward-compatible-core-context + no-forward-compatible-core-context no-layout-qualifiers-on-old-glsl Context flags: Supported GLSL versions: