From b52d0e345d8075d58d109140bb4fd13bdb188032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 7 Jan 2016 17:50:58 +0100 Subject: [PATCH] Fix false-positive AMD/NVidia driver detection on OSX. Apple has its own drivers but still names the vendor the same way as if it were the Windows/Linux binary drivers. Weird and/or sneaky. --- src/Magnum/Context.h | 2 +- src/Magnum/Implementation/driverSpecific.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Magnum/Context.h b/src/Magnum/Context.h index 6e75f0319..06a2e93d5 100644 --- a/src/Magnum/Context.h +++ b/src/Magnum/Context.h @@ -212,7 +212,7 @@ class MAGNUM_EXPORT Context { #endif #ifndef MAGNUM_TARGET_WEBGL - /** Binary NVidia drivers */ + /** Binary NVidia drivers on Windows and Linux */ NVidia = 1 << 2, #endif diff --git a/src/Magnum/Implementation/driverSpecific.cpp b/src/Magnum/Implementation/driverSpecific.cpp index 3efda5e03..f480b3805 100644 --- a/src/Magnum/Implementation/driverSpecific.cpp +++ b/src/Magnum/Implementation/driverSpecific.cpp @@ -115,6 +115,8 @@ auto Context::detectedDriver() -> DetectedDrivers { const std::string vendor = vendorString(); + /* Apple has its own drivers */ + #ifndef CORRADE_TARGET_APPLE #ifndef MAGNUM_TARGET_GLES /* AMD binary desktop drivers */ if(vendor.find("ATI Technologies Inc.") != std::string::npos) @@ -131,6 +133,7 @@ auto Context::detectedDriver() -> DetectedDrivers { if(vendor.find("NVIDIA Corporation") != std::string::npos) return *_detectedDrivers |= DetectedDriver::NVidia; #endif + #endif /** @todo there is also D3D9/D3D11 distinction on webglreport.com, is it useful? */ #ifdef MAGNUM_TARGET_GLES