summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl/qopengl_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/opengl/qopengl_p.h')
-rw-r--r--src/gui/opengl/qopengl_p.h24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/gui/opengl/qopengl_p.h b/src/gui/opengl/qopengl_p.h
index e04ae05120..980e02aea6 100644
--- a/src/gui/opengl/qopengl_p.h
+++ b/src/gui/opengl/qopengl_p.h
@@ -74,16 +74,34 @@ private:
class Q_GUI_EXPORT QOpenGLConfig
{
public:
- struct Gpu {
+ struct Q_GUI_EXPORT Gpu {
Gpu() : vendorId(0), deviceId(0) {}
- bool isValid() const { return deviceId; }
+ bool isValid() const { return deviceId || !glVendor.isEmpty(); }
bool equals(const Gpu &other) const {
- return vendorId == other.vendorId && deviceId == other.deviceId && driverVersion == other.driverVersion;
+ return vendorId == other.vendorId && deviceId == other.deviceId && driverVersion == other.driverVersion
+ && glVendor == other.glVendor;
}
uint vendorId;
uint deviceId;
QVersionNumber driverVersion;
+ QByteArray glVendor;
+
+ static Gpu fromDevice(uint vendorId, uint deviceId, QVersionNumber driverVersion) {
+ Gpu gpu;
+ gpu.vendorId = vendorId;
+ gpu.deviceId = deviceId;
+ gpu.driverVersion = driverVersion;
+ return gpu;
+ }
+
+ static Gpu fromGLVendor(const QByteArray &glVendor) {
+ Gpu gpu;
+ gpu.glVendor = glVendor;
+ return gpu;
+ }
+
+ static Gpu fromContext();
};
static QSet<QString> gpuFeatures(const Gpu &gpu,