From 539ca79c587973192f333cc73b1654df44dcc218 Mon Sep 17 00:00:00 2001 From: Karl Robillard Date: Tue, 9 Dec 2025 08:15:29 -0500 Subject: [PATCH] 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. --- src/platform/guiqt.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/platform/guiqt.cpp b/src/platform/guiqt.cpp index 21612ed81..518dafc90 100644 --- a/src/platform/guiqt.cpp +++ b/src/platform/guiqt.cpp @@ -1044,6 +1044,16 @@ int main(int argc, char** argv) { // See https://bugreports.qt.io/browse/QTBUG-89812 QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true); + // Specify the GL version so Qt doesn't use GLES on Wayland, which + // doesn't handle "#version 120" shaders. + { + QSurfaceFormat fmt; + fmt.setRenderableType(QSurfaceFormat::OpenGL); + fmt.setVersion(3, 2); + fmt.setProfile(QSurfaceFormat::CoreProfile); + QSurfaceFormat::setDefaultFormat(fmt); + } + Platform::SSApplication app(argc, argv); Platform::Open3DConnexion(); SS.Init();