diff options
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/main.cpp | 12 |
3 files changed, 9 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 015bc14..dcf53a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,7 @@ project(QMLBench set(QT_NO_INTERNAL_COMPATIBILITY_FUNCTIONS TRUE) # special case end -find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core Gui Qml Quick Test) +find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core Gui Qml Quick Test Quick3D) qt_build_repo_begin() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7e07d67..0bbb260 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -15,6 +15,7 @@ qt_internal_add_executable(qmlbench PUBLIC_LIBRARIES Qt::Gui Qt::Quick + Qt::Quick3D ) # Resources: diff --git a/src/main.cpp b/src/main.cpp index a57b3e6..667e25f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -32,6 +32,7 @@ #include <QtCore> #include <QtGui> #include <QtQuick> +#include <QtQuick3D> #include "benchmark.h" #include "benchmarkrunner.h" @@ -239,7 +240,7 @@ QStringList processCommandLineArguments(const QCoreApplication &app) return parser.positionalArguments(); } -void setupDefaultSurfaceFormat(int argc, char **argv) +void setupDefaultSurfaceFormat(int argc, char **argv, bool subprocess) { bool frameCountShell = true; // default for (int i = 0; i < argc; ++i) { @@ -249,6 +250,9 @@ void setupDefaultSurfaceFormat(int argc, char **argv) } } + if (subprocess) + QSurfaceFormat::setDefaultFormat(QQuick3D::idealSurfaceFormat()); + if (frameCountShell) { QSurfaceFormat format = QSurfaceFormat::defaultFormat(); #if QT_VERSION >= 0x050300 @@ -394,10 +398,6 @@ static QObject *qmlbench_singleton_provider(QQmlEngine *, QJSEngine *) int main(int argc, char **argv) { - // We need to do this early on, so there's no interference from the shared - // GL context. - setupDefaultSurfaceFormat(argc, argv); - // If it's not set, set the Qt Quick Controls style to Basic to ensure consistent results. const QByteArray controlsStyle = qgetenv("QT_QUICK_CONTROLS_STYLE"); if (controlsStyle.isEmpty()) @@ -432,6 +432,8 @@ int main(int argc, char **argv) int ret = 0; + setupDefaultSurfaceFormat(argc, argv, needsGui); + // qmlbench works as a split process mode. The parent process // (!isSubProcess) proxies a bunch of child processes that actually do the // work, and report output back to the parent. This keeps the benchmark |