aboutsummaryrefslogtreecommitdiffstats
path: root/src/app
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@qt.io>2023-11-14 11:36:40 +0200
committerMiikka Heikkinen <miikka.heikkinen@qt.io>2023-11-14 10:16:14 +0000
commitd581c80fe6c42abb80a18fde0847cdc8d01ee5c9 (patch)
tree7c8cc47f23bf616c2867359025d85ad112214c72 /src/app
parentdd2a2909630948ee89cb1dda7e0bb804bcb3dfc0 (diff)
Use OpenGL core profile for macOS
Some of the shader features we use in Effect Maker plugin require newer OpenGL than the macOS default. Task-number: QDS-11194 Change-Id: Iad166a9f99b2a8fc37b0f9912947cf63ef4b3328 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'src/app')
-rw-r--r--src/app/main.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/app/main.cpp b/src/app/main.cpp
index 036d169c06..c7857dcd9d 100644
--- a/src/app/main.cpp
+++ b/src/app/main.cpp
@@ -35,6 +35,7 @@
#include <QScopeGuard>
#include <QStandardPaths>
#include <QStyle>
+#include <QSurfaceFormat>
#include <QTextCodec>
#include <QTextStream>
#include <QThreadPool>
@@ -524,6 +525,15 @@ int main(int argc, char **argv)
}
}
+ if (Utils::HostOsInfo::isMacHost()) {
+ QSurfaceFormat surfaceFormat;
+ surfaceFormat.setStencilBufferSize(8);
+ surfaceFormat.setDepthBufferSize(24);
+ surfaceFormat.setVersion(4, 1);
+ surfaceFormat.setProfile(QSurfaceFormat::CoreProfile);
+ QSurfaceFormat::setDefaultFormat(surfaceFormat);
+ }
+
qputenv("QSG_RHI_BACKEND", "opengl");
if (qEnvironmentVariableIsSet("QTCREATOR_DISABLE_NATIVE_MENUBAR")