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>
bb10
Laszlo Agocs 2020-04-21 12:03:37 +02:00
parent 8524d29ce8
commit 1d7965fc41
1 changed files with 10 additions and 9 deletions

View File

@ -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