diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-05-10 12:46:44 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-05-10 12:46:44 +0200 |
commit | 5271186f2f826cc6667766d9db32c1ca8b0743ec (patch) | |
tree | 424ce1adfe4f423621d1b1b95a2823271f10329c /main | |
parent | 31fc7a8525603e0e0b35438de4f66c73378915cc (diff) | |
parent | 98c655ec8db17e50afa58284b1dcad754034db4b (diff) | |
download | redot-engine-5271186f2f826cc6667766d9db32c1ca8b0743ec.tar.gz |
Merge pull request #75901 from reduz/refactor-node-processing
Refactor Node Processing to allow Scene Multithreading
Diffstat (limited to 'main')
-rw-r--r-- | main/main.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/main/main.cpp b/main/main.cpp index baa8692a87..797aa32441 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -182,6 +182,7 @@ static int converter_max_line_length = 100000; HashMap<Main::CLIScope, Vector<String>> forwardable_cli_arguments; #endif +static bool single_threaded_scene = false; bool use_startup_benchmark = false; String startup_benchmark_file; @@ -453,6 +454,7 @@ void Main::print_help(const char *p_binary) { OS::get_singleton()->print(" --gpu-abort Abort on graphics API usage errors (usually validation layer errors). May help see the problem if your system freezes.\n"); #endif OS::get_singleton()->print(" --remote-debug <uri> Remote debug (<protocol>://<host/IP>[:<port>], e.g. tcp://127.0.0.1:6007).\n"); + OS::get_singleton()->print(" --single-threaded-scene Scene tree runs in single-threaded mode. Sub-thread groups are disabled and run on the main thread.\n"); #if defined(DEBUG_ENABLED) OS::get_singleton()->print(" --debug-collisions Show collision shapes when running the scene.\n"); OS::get_singleton()->print(" --debug-paths Show path lines when running the scene.\n"); @@ -1142,6 +1144,8 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph OS::get_singleton()->print("Missing remote debug server uri, aborting.\n"); goto error; } + } else if (I->get() == "--single-threaded-scene") { + single_threaded_scene = true; } else if (I->get() == "--build-solutions") { // Build the scripting solution such C# auto_build_solutions = true; @@ -2866,6 +2870,10 @@ bool Main::start() { } #endif + if (single_threaded_scene) { + sml->set_disable_node_threading(true); + } + bool embed_subwindows = GLOBAL_GET("display/window/subwindows/embed_subwindows"); if (single_window || (!project_manager && !editor && embed_subwindows) || !DisplayServer::get_singleton()->has_feature(DisplayServer::Feature::FEATURE_SUBWINDOWS)) { |