From 1d7965fc418cfad97df582b8307b939737318985 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 21 Apr 2020 12:03:37 +0200 Subject: 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 Reviewed-by: Andy Nichols --- .../platforms/windows/qwindowsopengltester.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/plugins/platforms/windows/qwindowsopengltester.cpp') 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 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 features = QOpenGLConfig::gpuFeatures(qgpu, buglistFileName); qCDebug(lcQpaGl) << "GPU features:" << features; if (features.contains(QStringLiteral("disable_desktopgl"))) { // Qt-specific -- cgit v1.2.3