fix(SplashScreen): Enable threaded renderer
This commit is contained in:
parent
1a96700bb8
commit
58e9e61702
|
@ -93,6 +93,7 @@ proc mainProc() =
|
|||
let statusFoundation = newStatusFoundation(fleetConfig)
|
||||
let uiScaleFilePath = joinPath(DATADIR, "ui-scale")
|
||||
enableHDPI(uiScaleFilePath)
|
||||
tryEnableThreadedRenderer()
|
||||
initializeOpenGL()
|
||||
|
||||
let imageCert = imageServerTLSCert()
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
#include <QTranslator>
|
||||
#include <QSettings>
|
||||
#include <QTimer>
|
||||
#include <QSysInfo>
|
||||
#ifdef QT_QUICKCONTROLS2_LIB
|
||||
#include <QtQuickControls2/QQuickStyle>
|
||||
#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)
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 3769de5030c5d869b908568dfe409001d6868ea8
|
||||
Subproject commit 0788877b37373d904d59de6ac4f667f4158632fa
|
Loading…
Reference in New Issue