Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime NavigationMesh baking on thread broken due to new thread guards #77180

Closed
smix8 opened this issue May 17, 2023 · 0 comments · Fixed by #77412
Closed

Runtime NavigationMesh baking on thread broken due to new thread guards #77180

smix8 opened this issue May 17, 2023 · 0 comments · Fixed by #77412

Comments

@smix8
Copy link
Contributor

smix8 commented May 17, 2023

Godot version

da21cb7

System information

Windows 10

Issue description

The new thread guards added with the recent SceneTree thread groups from pr #75901 break the runtime baking of navigation meshes on a thread in debug builds.

The navigation mesh baking process first parses the child nodes recursive to gather source geometry for the baking. This process is now entirely blocked by the thread guards in debug builds. The guards make the SceneTree nodes inaccessible from threads. The navigation mesh baking process now suddenly has zero data to work with.

threadguardbug

Workaround is to use NavigationRegion3D.bake_navigation_mesh(false) or use the NavigationMeshGenerator.bake() directly with the NavigationMesh or to do as suggested by the error msg and call deferred so everything is done single-threaded on the main thread.

This is not really a solution that works for a release cause having the navigation mesh baking forced to single-thread will cause unavoidable and heavy performance issues for projects that change navigation meshes at runtime.

Steps to reproduce

Try to bake a navigation mesh at runtime with a background thread in a debug build.

Minimal reproduction project

see steps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant