Browse Source

GL: add detection for Qualcomm Adreno drivers.

They are on Android but also apparently Windows, so making them
available on all GLES platforms.
pull/168/head
Vladimír Vondruš 3 years ago
parent
commit
a00270cd6c
  1. 1
      doc/changelog.dox
  2. 6
      src/Magnum/GL/Context.cpp
  3. 13
      src/Magnum/GL/Context.h
  4. 5
      src/Magnum/GL/Implementation/driverSpecific.cpp

1
doc/changelog.dox

@ -519,6 +519,7 @@ See also:
- The @ref GL::Context class got significantly optimized in terms of compile - The @ref GL::Context class got significantly optimized in terms of compile
time, header size and runtime as well, significantly reducing the amount of time, header size and runtime as well, significantly reducing the amount of
allocations done at startup. allocations done at startup.
- Added @ref GL::Context::DetectedDriver::QualcommAdreno
- To make working with cube map images easier, - To make working with cube map images easier,
@ref GL::CubeMapTexture::setSubImage() and @ref GL::CubeMapTexture::setSubImage() and
@ref GL::CubeMapTexture::subImage() taking 3D images are now exposed on all @ref GL::CubeMapTexture::subImage() taking 3D images are now exposed on all

6
src/Magnum/GL/Context.cpp

@ -1348,6 +1348,9 @@ Debug& operator<<(Debug& debug, const Context::DetectedDriver value) {
#ifdef CORRADE_TARGET_ANDROID #ifdef CORRADE_TARGET_ANDROID
_c(ArmMali) _c(ArmMali)
#endif #endif
#if defined(MAGNUM_TARGET_GLES) && !defined(CORRADE_TARGET_APPLE)
_c(QualcommAdreno)
#endif
#undef _c #undef _c
/* LCOV_EXCL_STOP */ /* LCOV_EXCL_STOP */
} }
@ -1371,6 +1374,9 @@ Debug& operator<<(Debug& debug, const Context::DetectedDrivers value) {
#ifdef CORRADE_TARGET_ANDROID #ifdef CORRADE_TARGET_ANDROID
Context::DetectedDriver::ArmMali, Context::DetectedDriver::ArmMali,
#endif #endif
#if defined(MAGNUM_TARGET_GLES) && !defined(CORRADE_TARGET_APPLE)
Context::DetectedDriver::QualcommAdreno
#endif
}); });
} }
#endif #endif

13
src/Magnum/GL/Context.h

@ -489,7 +489,18 @@ class MAGNUM_GL_EXPORT Context {
* @ref CORRADE_TARGET_ANDROID "Android". * @ref CORRADE_TARGET_ANDROID "Android".
* @m_since{2019,10} * @m_since{2019,10}
*/ */
ArmMali = 1 << 7 ArmMali = 1 << 7,
#endif
#if (defined(MAGNUM_TARGET_GLES) && !defined(CORRADE_TARGET_APPLE)) || defined(DOXYGEN_GENERATING_OUTPUT)
/**
* Qualcomm Adreno drivers for OpenGL ES.
* @partialsupport Not available on
* @ref CORRADE_TARGET_APPLE"Apple" platforms.
* @m_since_latest
*/
/* Assuming these exist also on non-Android platforms (Windows?) */
QualcommAdreno = 1 << 8
#endif #endif
}; };

5
src/Magnum/GL/Implementation/driverSpecific.cpp

@ -581,6 +581,11 @@ auto Context::detectedDriver() -> DetectedDrivers {
*_detectedDrivers |= DetectedDriver::ArmMali; *_detectedDrivers |= DetectedDriver::ArmMali;
#endif #endif
#if defined(MAGNUM_TARGET_GLES) && !defined(CORRADE_TARGET_APPLE)
if(vendor.contains("Qualcomm"_s) && renderer.contains("Adreno"_s))
*_detectedDrivers |= DetectedDriver::QualcommAdreno;
#endif
return *_detectedDrivers; return *_detectedDrivers;
} }

Loading…
Cancel
Save