Browse Source

GL: detecting ARM Mali drivers on Android.

pull/331/head
Vladimír Vondruš 7 years ago
parent
commit
6c5d037005
  1. 5
      doc/changelog.dox
  2. 3
      src/Magnum/GL/Context.cpp
  3. 11
      src/Magnum/GL/Context.h
  4. 5
      src/Magnum/GL/Implementation/driverSpecific.cpp

5
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

3
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 */
}

11
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
};
/**

5
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;
}

Loading…
Cancel
Save