summaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2023-04-10 18:45:53 +0200
committerJuan Linietsky <reduzio@gmail.com>2023-05-09 19:17:51 +0200
commit98c655ec8db17e50afa58284b1dcad754034db4b (patch)
tree8ff8126e58e15a2c52724f783ca4ba194cf11ebb /main
parentcf8ad12b56df4ae7bba4c73070dd035693a880e4 (diff)
downloadredot-engine-98c655ec8db17e50afa58284b1dcad754034db4b.tar.gz
Refactor Node Processing
* Node processing works on the concept of process groups. * A node group can be inherited, run on main thread, or a sub-thread. * Groups can be ordered. * Process priority is now present for physics. This is the first steps towards implementing https://github.com/godotengine/godot-proposals/issues/6424. No threading or thread guards exist yet in most of the scene code other than Node. That will have to be added later.
Diffstat (limited to 'main')
-rw-r--r--main/main.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/main/main.cpp b/main/main.cpp
index 707ef6ec3d..4f99a93bd2 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -178,6 +178,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;
@@ -423,6 +424,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");
@@ -1108,6 +1110,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;
@@ -2780,6 +2784,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)) {