diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-03-09 13:54:29 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-03-11 19:23:17 +0000 |
commit | 85620bd788d351018e9fa0b0f567b19a773be52b (patch) | |
tree | 7307e1b5ef650d168571351c2549827eb343b1c6 /src/gui/opengl/qopengl_p.h | |
parent | 22afbc153628348bc6d4ee0655ea6a6584a13322 (diff) |
windows: Introduce a built-in GPU blacklist
Use a built-in JSON file in case the QT_OPENGL_BUGLIST environment
variable is not set. When QT_OPENGL_BUGLIST is set, the built-in list
is ignored.
To make the implementation simpler and more readable, some of the code
in QWindowsOpenGLTester is reshuffled a bit. It also caches the results
now, so it is safe and fast to call supportedRenderers() and friends
multiple times.
The blacklist currently contains the Intel card from QTBUG-43263 (Intel
GMA / HD3000 ?) and may also apply to QTBUG-42240.
[ChangeLog][QtGui] Qt now contains a built-in GPU driver blacklist for
Windows that disables the usage of desktop OpenGL with some older cards
that are known to be unstable with opengl32.dll.
Task-number: QTBUG-42240
Task-number: QTBUG-43263
Change-Id: I1ecd65b51fca77925317d52048e7ab01d9b8797c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Diffstat (limited to 'src/gui/opengl/qopengl_p.h')
-rw-r--r-- | src/gui/opengl/qopengl_p.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gui/opengl/qopengl_p.h b/src/gui/opengl/qopengl_p.h index 377440455a..e04ae05120 100644 --- a/src/gui/opengl/qopengl_p.h +++ b/src/gui/opengl/qopengl_p.h @@ -77,6 +77,9 @@ public: struct Gpu { Gpu() : vendorId(0), deviceId(0) {} bool isValid() const { return deviceId; } + bool equals(const Gpu &other) const { + return vendorId == other.vendorId && deviceId == other.deviceId && driverVersion == other.driverVersion; + } uint vendorId; uint deviceId; @@ -93,6 +96,21 @@ public: static QSet<QString> gpuFeatures(const Gpu &gpu, const QString &fileName); }; +inline bool operator==(const QOpenGLConfig::Gpu &a, const QOpenGLConfig::Gpu &b) +{ + return a.equals(b); +} + +inline bool operator!=(const QOpenGLConfig::Gpu &a, const QOpenGLConfig::Gpu &b) +{ + return !a.equals(b); +} + +inline uint qHash(const QOpenGLConfig::Gpu &gpu) +{ + return qHash(gpu.vendorId) + qHash(gpu.deviceId) + qHash(gpu.driverVersion); +} + QT_END_NAMESPACE #endif // QOPENGL_H |