Fix thread-use causing navigation source geometry data corruption #93407
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes navigation source geometry data corruption caused by thread-use that changed vertices or indices while the source geometry data was used in a parsing process or read from by the navmesh baking.
resolves #90934
Pairs with #93392
set_data()
andget_data()
in one call to avoid desync.The issue was the same as with the navigation mesh. If users kept a source geometry object around to add procedual geometry for baking, e.g. with a chunk system, they did run into conflict when using a thread for the procedual "parsing" or baking step by corrupting the source data.
I tested this and the other PR together by baking various large godot 3D demos while also adding custom geometry without a lock issue or crash, still more testing is welcome.
TODO would be to extend to the navigation mesh generator parsing as well but that requires also changing the nodes so postponed for now as that part needs to run single-threaded anyway due to the SceneTree.