Browse Source

Detecting VMware SVGA3D driver.

The SVGA3D driver is used on Windows as well, which means Mesa is now
detected on Windows too.
pull/203/merge
Vladimír Vondruš 9 years ago
parent
commit
0455800111
  1. 6
      src/Magnum/Context.cpp
  2. 17
      src/Magnum/Context.h
  3. 13
      src/Magnum/Implementation/driverSpecific.cpp

6
src/Magnum/Context.cpp

@ -904,6 +904,9 @@ Debug& operator<<(Debug& debug, const Context::DetectedDriver value) {
_c(Mesa)
_c(NVidia)
#endif
#ifndef MAGNUM_TARGET_WEBGL
_c(Svga3D)
#endif
#undef _c
/* LCOV_EXCL_STOP */
}
@ -924,6 +927,9 @@ Debug& operator<<(Debug& debug, const Context::DetectedDrivers value) {
Context::DetectedDriver::Mesa,
Context::DetectedDriver::NVidia,
#endif
#ifndef MAGNUM_TARGET_WEBGL
Context::DetectedDriver::Svga3D
#endif
});
}
#endif

17
src/Magnum/Context.h

@ -256,7 +256,8 @@ class MAGNUM_EXPORT Context {
IntelWindows = 1 << 2,
/**
* Mesa drivers on Linux
* Mesa drivers on Windows and Linux. See also
* @ref DetectedDriver::Svga3D.
* @requires_gles Not detectable on WebGL, as browsers
* intentionally hide most of the driver information.
*/
@ -267,7 +268,19 @@ class MAGNUM_EXPORT Context {
* @requires_gles Not detectable on WebGL, as browsers
* intentionally hide most of the driver information.
*/
NVidia = 1 << 4
NVidia = 1 << 4,
#endif
#ifndef MAGNUM_TARGET_WEBGL
/**
* VMware guest GL driver SVGA3D, implemented using Mesa, both
* Windows and Linux guests. See https://www.mesa3d.org/vmware-guest.html
* for more information. Detected in combination with
* @ref DetectedDriver::Mesa.
* @requires_gles Not detectable on WebGL, as browsers
* intentionally hide most of the driver information.
*/
Svga3D = 1 << 5
#endif
};

13
src/Magnum/Implementation/driverSpecific.cpp

@ -130,6 +130,7 @@ auto Context::detectedDriver() -> DetectedDrivers {
_detectedDrivers = DetectedDrivers{};
const std::string renderer = rendererString();
const std::string vendor = vendorString();
const std::string version = versionString();
@ -145,11 +146,15 @@ auto Context::detectedDriver() -> DetectedDrivers {
return *_detectedDrivers |= DetectedDriver::IntelWindows;
#endif
#ifdef CORRADE_TARGET_UNIX
/* Mesa drivers */
if(version.find("Mesa") != std::string::npos)
return *_detectedDrivers |= DetectedDriver::Mesa;
#endif
if(version.find("Mesa") != std::string::npos) {
*_detectedDrivers |= DetectedDriver::Mesa;
if(renderer.find("SVGA3D") != std::string::npos)
*_detectedDrivers |= DetectedDriver::Svga3D;
return *_detectedDrivers;
}
if(vendor.find("NVIDIA Corporation") != std::string::npos)
return *_detectedDrivers |= DetectedDriver::NVidia;

Loading…
Cancel
Save