fix: allow disabling gl and vulkan features with an envvar and disable it by default on appimage/portable

the previous approach didn't work with runtime symbol lookup errors

Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com>
This commit is contained in:
DioEgizio 2026-03-20 15:31:34 +01:00
parent 348907f7d1
commit e524fa5b6b
4 changed files with 19 additions and 0 deletions

View file

@ -21,6 +21,7 @@
#include <QCoreApplication>
#include <QOffscreenSurface>
#include <QOpenGLFunctions>
#include <QProcessEnvironment>
#ifndef Q_OS_MACOS
#include <QVulkanInstance>
@ -30,6 +31,9 @@
namespace {
bool vulkanInfo(QStringList& out)
{
if (!QProcessEnvironment::systemEnvironment().value(QStringLiteral("LAUNCHER_DISABLE_GLVULKAN")).isEmpty()) {
return false;
}
#ifndef Q_OS_MACOS
QVulkanInstance inst;
if (!inst.create()) {
@ -53,6 +57,9 @@ bool vulkanInfo(QStringList& out)
bool openGlInfo(QStringList& out)
{
if (!QProcessEnvironment::systemEnvironment().value(QStringLiteral("LAUNCHER_DISABLE_GLVULKAN")).isEmpty()) {
return false;
}
QOpenGLContext ctx;
if (!ctx.create()) {
qWarning() << "OpenGL context creation failed";