diff options
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 |