Merge pull request #75365 from Calinou/doc-thread-model-multi-threaded-bugs

Document known bugs with the Multi-Threaded thread model project setting
This commit is contained in:
Rémi Verschelde 2023-06-14 09:23:07 +02:00
commit 0ebd2aea45
No known key found for this signature in database
GPG key ID: C3336907360768E1
2 changed files with 11 additions and 2 deletions

View file

@ -2226,7 +2226,8 @@
[b]Note:[/b] Depth prepass is only supported when using the Forward+ or Compatibility rendering method. When using the Mobile rendering method, there is no depth prepass performed. [b]Note:[/b] Depth prepass is only supported when using the Forward+ or Compatibility rendering method. When using the Mobile rendering method, there is no depth prepass performed.
</member> </member>
<member name="rendering/driver/threads/thread_model" type="int" setter="" getter="" default="1"> <member name="rendering/driver/threads/thread_model" type="int" setter="" getter="" default="1">
Thread model for rendering. Rendering on a thread can vastly improve performance, but synchronizing to the main thread can cause a bit more jitter. The thread model to use for rendering. Rendering on a thread may improve performance, but synchronizing to the main thread can cause a bit more jitter.
[b]Note:[/b] The [b]Multi-Threaded[/b] option is experimental, and has several known bugs which can lead to crashing, especially when using particles or resizing the window. Not recommended for use in production at this stage.
</member> </member>
<member name="rendering/environment/defaults/default_clear_color" type="Color" setter="" getter="" default="Color(0.3, 0.3, 0.3, 1)"> <member name="rendering/environment/defaults/default_clear_color" type="Color" setter="" getter="" default="Color(0.3, 0.3, 0.3, 1)">
Default background clear color. Overridable per [Viewport] using its [Environment]. See [member Environment.background_mode] and [member Environment.background_color] in particular. To change this default color programmatically, use [method RenderingServer.set_default_clear_color]. Default background clear color. Overridable per [Viewport] using its [Environment]. See [member Environment.background_mode] and [member Environment.background_color] in particular. To change this default color programmatically, use [method RenderingServer.set_default_clear_color].

View file

@ -1150,6 +1150,9 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
rtm = OS::RENDER_THREAD_UNSAFE; rtm = OS::RENDER_THREAD_UNSAFE;
} else if (I->next()->get() == "separate") { } else if (I->next()->get() == "separate") {
rtm = OS::RENDER_SEPARATE_THREAD; rtm = OS::RENDER_SEPARATE_THREAD;
} else {
OS::get_singleton()->print("Unknown render thread mode, aborting.\nValid options are 'unsafe', 'safe' and 'separate'.\n");
goto error;
} }
N = I->next()->next(); N = I->next()->next();
@ -1875,7 +1878,8 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
} }
if (rtm >= 0 && rtm < 3) { if (rtm >= 0 && rtm < 3) {
if (editor) { if (editor || project_manager) {
// Editor and project manager cannot run with rendering in a separate thread (they will crash on startup).
rtm = OS::RENDER_THREAD_SAFE; rtm = OS::RENDER_THREAD_SAFE;
} }
OS::get_singleton()->_render_thread_mode = OS::RenderThreadMode(rtm); OS::get_singleton()->_render_thread_mode = OS::RenderThreadMode(rtm);
@ -2209,6 +2213,10 @@ Error Main::setup2() {
} }
} }
if (OS::get_singleton()->_render_thread_mode == OS::RENDER_SEPARATE_THREAD) {
WARN_PRINT("The Multi-Threaded rendering thread model is experimental, and has known issues which can lead to project crashes. Use the Single-Safe option in the project settings instead.");
}
/* Initialize Pen Tablet Driver */ /* Initialize Pen Tablet Driver */
{ {