diff --git a/doc/changelog.dox b/doc/changelog.dox index 3cef590d5..c3070f652 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -97,8 +97,9 @@ See also: - New `--magnum-gpu-validation` @ref GL-Context-command-line "command-line option" and a corresponding environment variable to conveniently enable @gl_extension{KHR,debug} debug output -- Detection of SwiftShader drivers with - @ref GL::Context::DetectedDriver::SwiftShader +- Detection of SwiftShader and ARM Mali drivers with + @ref GL::Context::DetectedDriver::SwiftShader and + @ref GL::Context::DetectedDriver::ArmMali @subsubsection changelog-latest-new-platform Platform libraries diff --git a/src/Magnum/GL/Context.cpp b/src/Magnum/GL/Context.cpp index 87c3b69ec..42795f62d 100644 --- a/src/Magnum/GL/Context.cpp +++ b/src/Magnum/GL/Context.cpp @@ -978,6 +978,9 @@ Debug& operator<<(Debug& debug, const Context::DetectedDriver value) { _c(SwiftShader) #endif #endif + #ifdef CORRADE_TARGET_ANDROID + _c(ArmMali) + #endif #undef _c /* LCOV_EXCL_STOP */ } diff --git a/src/Magnum/GL/Context.h b/src/Magnum/GL/Context.h index a489675d5..dee0c01b6 100644 --- a/src/Magnum/GL/Context.h +++ b/src/Magnum/GL/Context.h @@ -384,9 +384,18 @@ class MAGNUM_GL_EXPORT Context { * contexts. Not detectable on WebGL, as browsers * intentionally hide most of the driver information. */ - SwiftShader = 1 << 6 + SwiftShader = 1 << 6, #endif #endif + + #if defined(CORRADE_TARGET_ANDROID) || defined(DOXYGEN_GENERATING_OUTPUT) + /** + * ARM Mali drivers on OpenGL ES. + * @partialsupport Available only on + * @ref CORRADE_TARGET_ANDROID "Android". + */ + ArmMali = 1 << 7 + #endif }; /** diff --git a/src/Magnum/GL/Implementation/driverSpecific.cpp b/src/Magnum/GL/Implementation/driverSpecific.cpp index ff15549b9..add04c066 100644 --- a/src/Magnum/GL/Implementation/driverSpecific.cpp +++ b/src/Magnum/GL/Implementation/driverSpecific.cpp @@ -339,6 +339,11 @@ auto Context::detectedDriver() -> DetectedDrivers { #endif #endif + #ifdef CORRADE_TARGET_ANDROID + if(vendor.find("ARM") != std::string::npos && renderer.find("Mali") != std::string::npos) + return *_detectedDrivers |= DetectedDriver::ArmMali; + #endif + return *_detectedDrivers; }