mirror of
https://github.com/godotengine/godot.git
synced 2024-11-21 03:18:37 +08:00
0db5123548
The previous commit corrected the RNG behavior for the lightbaker but also made it significantly slower on high core count systems. Due to the vector of states being physically close together in RAM we force a cache synchronization across all cores whenever we call for the next random number to be generated. This will create a temporary local copy of the RNG state before entering the loop and then saving it back to the global state when done. This will preserve the per-thread RNG state (and random number quality) while significantly improving performance. On my 16 thread box it saves 3 minutes baking the Sponza scene, bringing performance back in line to before the various RNG fixes were introduced, being slightly faster than the first implementation. |
||
---|---|---|
.. | ||
2d | ||
3d | ||
animation | ||
audio | ||
gui | ||
main | ||
resources | ||
register_scene_types.cpp | ||
register_scene_types.h | ||
scene_string_names.cpp | ||
scene_string_names.h | ||
SCsub |