Skip to content

Commit eaefb5d

Browse files
WickedSmokephkahler
authored andcommitted
Qt: Request a specific GL version so GLES doesn't get used on Wayland.
Without this "QT_QPA_PLATFORM=xcb" is needed on Wayland or else the shaders may not compile.
1 parent 7312dd7 commit eaefb5d

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/platform/guiqt.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,6 +1044,16 @@ int main(int argc, char** argv) {
10441044
// See https://bugreports.qt.io/browse/QTBUG-89812
10451045
QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true);
10461046

1047+
// Specify the GL version so Qt doesn't use GLES on Wayland, which
1048+
// doesn't handle "#version 120" shaders.
1049+
{
1050+
QSurfaceFormat fmt;
1051+
fmt.setRenderableType(QSurfaceFormat::OpenGL);
1052+
fmt.setVersion(3, 2);
1053+
fmt.setProfile(QSurfaceFormat::CoreProfile);
1054+
QSurfaceFormat::setDefaultFormat(fmt);
1055+
}
1056+
10471057
Platform::SSApplication app(argc, argv);
10481058
Platform::Open3DConnexion();
10491059
SS.Init();

0 commit comments

Comments
 (0)