summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-05-16 13:47:06 +0200
committerGitHub <noreply@github.com>2022-05-16 13:47:06 +0200
commit95da5436dcc8a7a4df290923b760ad0a910baaed (patch)
treed97e58b0dfb1c308fbe2db20cf276c86a9081191 /scene
parentf3c0e75fbae70acae4a3d5c2201ca3a281f7575f (diff)
parent49c603e1276b84f9b80414946429372f173bcbeb (diff)
Merge pull request #61032 from smix8/navigationmesh_bake_no_threads_4.x
Diffstat (limited to 'scene')
-rw-r--r--scene/3d/navigation_region_3d.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/scene/3d/navigation_region_3d.cpp b/scene/3d/navigation_region_3d.cpp
index 80be770dfc..6404432631 100644
--- a/scene/3d/navigation_region_3d.cpp
+++ b/scene/3d/navigation_region_3d.cpp
@@ -171,7 +171,12 @@ void NavigationRegion3D::bake_navigation_mesh(bool p_on_thread) {
BakeThreadsArgs *args = memnew(BakeThreadsArgs);
args->nav_region = this;
- if (p_on_thread) {
+ if (p_on_thread && !OS::get_singleton()->can_use_threads()) {
+ WARN_PRINT("NavigationMesh bake 'on_thread' will be disabled as the current OS does not support multiple threads."
+ "\nAs a fallback the navigation mesh will bake on the main thread which can cause framerate issues.");
+ }
+
+ if (p_on_thread && OS::get_singleton()->can_use_threads()) {
bake_thread.start(_bake_navigation_mesh, args);
} else {
_bake_navigation_mesh(args);