diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-04-21 12:03:37 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-04-21 13:49:47 +0200 |
commit | 1d7965fc418cfad97df582b8307b939737318985 (patch) | |
tree | 3e0812a3f12b3a38597a0c55a66da9911148d60d /src/plugins/platforms/windows/qwindowsopengltester.cpp | |
parent | 8524d29ce8aa16c65abd8eb6688ce24b710fe356 (diff) |
windows: Add QT_NO_OPENGL_BUGLIST environment variable
The typical approach of setting QT_OPENGL_BUGLIST to a non-existing file is neither
documented nor is very friendly. Instead, add a QT_NO_* style of variable that
skips reading the JSON config file altogether.
This can then be used in more exotic, possibly virtualized, environments to disable
the driver and adapter discovery, and instead assume that OpenGL is available and
fully usable.
Task-number: QTBUG-82372
Pick-to: 5.15
Change-Id: I192baa83c5d9760ee27873385a246fef87421b16
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsopengltester.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowsopengltester.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/plugins/platforms/windows/qwindowsopengltester.cpp b/src/plugins/platforms/windows/qwindowsopengltester.cpp index 72092a4481..d7d186e804 100644 --- a/src/plugins/platforms/windows/qwindowsopengltester.cpp +++ b/src/plugins/platforms/windows/qwindowsopengltester.cpp @@ -322,16 +322,17 @@ QWindowsOpenGLTester::Renderers QWindowsOpenGLTester::detectSupportedRenderers(c result |= QWindowsOpenGLTester::DesktopGl; } - const char bugListFileVar[] = "QT_OPENGL_BUGLIST"; - QString buglistFileName = QStringLiteral(":/qt-project.org/windows/openglblacklists/default.json"); - - if (qEnvironmentVariableIsSet(bugListFileVar)) { - const QString fileName = resolveBugListFile(QFile::decodeName(qgetenv(bugListFileVar))); - if (!fileName.isEmpty()) - buglistFileName = fileName; + QSet<QString> features; // empty by default -> nothing gets disabled + if (!qEnvironmentVariableIsSet("QT_NO_OPENGL_BUGLIST")) { + const char bugListFileVar[] = "QT_OPENGL_BUGLIST"; + QString buglistFileName = QStringLiteral(":/qt-project.org/windows/openglblacklists/default.json"); + if (qEnvironmentVariableIsSet(bugListFileVar)) { + const QString fileName = resolveBugListFile(QFile::decodeName(qgetenv(bugListFileVar))); + if (!fileName.isEmpty()) + buglistFileName = fileName; + } + features = QOpenGLConfig::gpuFeatures(qgpu, buglistFileName); } - - QSet<QString> features = QOpenGLConfig::gpuFeatures(qgpu, buglistFileName); qCDebug(lcQpaGl) << "GPU features:" << features; if (features.contains(QStringLiteral("disable_desktopgl"))) { // Qt-specific |