From 58e9e617027a9cea7e8483522dfe1dfda2e9fd3e Mon Sep 17 00:00:00 2001 From: Alex Jbanca Date: Thu, 2 Mar 2023 11:08:09 +0200 Subject: [PATCH] fix(SplashScreen): Enable threaded renderer --- src/nim_status_client.nim | 1 + vendor/DOtherSide/lib/include/DOtherSide/DOtherSide.h | 2 ++ vendor/DOtherSide/lib/src/DOtherSide.cpp | 11 +++++++++++ vendor/nimqml | 2 +- 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/nim_status_client.nim b/src/nim_status_client.nim index f096e3ad7b..0e406fe320 100644 --- a/src/nim_status_client.nim +++ b/src/nim_status_client.nim @@ -93,6 +93,7 @@ proc mainProc() = let statusFoundation = newStatusFoundation(fleetConfig) let uiScaleFilePath = joinPath(DATADIR, "ui-scale") enableHDPI(uiScaleFilePath) + tryEnableThreadedRenderer() initializeOpenGL() let imageCert = imageServerTLSCert() diff --git a/vendor/DOtherSide/lib/include/DOtherSide/DOtherSide.h b/vendor/DOtherSide/lib/include/DOtherSide/DOtherSide.h index 5404e3f894..9db79abffe 100644 --- a/vendor/DOtherSide/lib/include/DOtherSide/DOtherSide.h +++ b/vendor/DOtherSide/lib/include/DOtherSide/DOtherSide.h @@ -60,6 +60,8 @@ DOS_API void DOS_CALL dos_qguiapplication_enable_hdpi(const char *uiScaleFilePat DOS_API void DOS_CALL dos_qguiapplication_initialize_opengl(void); +DOS_API void DOS_CALL dos_qguiapplication_try_enable_threaded_renderer(); + /// \brief Create a QGuiApplication /// \note The created QGuiApplication should be freed by calling dos_qguiapplication_delete() DOS_API void DOS_CALL dos_qguiapplication_create(); diff --git a/vendor/DOtherSide/lib/src/DOtherSide.cpp b/vendor/DOtherSide/lib/src/DOtherSide.cpp index 89dd7f63e9..e149cbca9d 100644 --- a/vendor/DOtherSide/lib/src/DOtherSide.cpp +++ b/vendor/DOtherSide/lib/src/DOtherSide.cpp @@ -50,6 +50,7 @@ #include #include #include +#include #ifdef QT_QUICKCONTROLS2_LIB #include #endif @@ -188,6 +189,16 @@ void dos_qguiapplication_initialize_opengl() QGuiApplication::setAttribute(Qt::AA_ShareOpenGLContexts); } +void dos_qguiapplication_try_enable_threaded_renderer() +{ + if(QSysInfo::buildCpuArchitecture() == "arm64" && QSysInfo::kernelType() == "darwin" && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) + { + //Threaded renderer is crashing on M1 Macs + return; + } + qputenv("QSG_RENDER_LOOP", "threaded"); +} + // This catches the QT and QML logs and outputs them. // This is necessary on Windows, because otherwise we do not get any logs at all void myMessageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg) diff --git a/vendor/nimqml b/vendor/nimqml index 3769de5030..0788877b37 160000 --- a/vendor/nimqml +++ b/vendor/nimqml @@ -1 +1 @@ -Subproject commit 3769de5030c5d869b908568dfe409001d6868ea8 +Subproject commit 0788877b37373d904d59de6ac4f667f4158632fa