Commit graph

9 commits

Author SHA1 Message Date
luz.paz 7bf6e5f773 Fix various typos
Found via `codespell`
2020-03-11 13:59:18 -04:00
Pedro J. Estébanez 18fbdbb456 Reimplement Mutex with C++'s <mutex>
Main:
- It's now implemented thanks to `<mutex>`. No more platform-specific implementations.
- `BinaryMutex` (non-recursive) is added, as an alternative for special cases.
- Doesn't need allocation/deallocation anymore. It can live in the stack and be part of other classes.
- Because of that, it's methods are now `const` and the inner mutex is `mutable` so it can be easily used in `const` contexts.
- A no-op implementation is provided if `NO_THREADS` is defined. No more need to add `#ifdef NO_THREADS` just for this.
- `MutexLock` now takes a reference. At this point the cases of null `Mutex`es are rare. If you ever need that, just don't use `MutexLock`.
- Thread-safe utilities are therefore simpler now.

Misc.:
- `ScopedMutexLock` is dropped and replaced by `MutexLock`, because they were pretty much the same.
- Every case of lock, do-something, unlock is replaced by `MutexLock` (complex cases where it's not straightfoward are kept as as explicit lock and unlock).
- `ShaderRD` contained an `std::mutex`, which has been replaced by `Mutex`.
2020-02-26 20:40:10 +01:00
Andrea Catania c143b5c677 Flushes commands just before the navigation server is destroyed 2020-02-26 09:42:51 +01:00
Andrea Catania 79fc7d7d6a Added utility functions to the new NavigationServer:
- Vector3 get_closest_point_to_segment(const Vector3 &p_from, const Vector3 &p_to, const bool &p_use_collision = false);
- Vector3 get_closest_point(const Vector3 &p_point);
- Vector3 get_closest_point_normal(const Vector3 &p_point);
- Object *get_closest_point_owner(const Vector3 &p_point);
2020-02-18 17:12:45 +01:00
Haoyu Qiu d9b5cbdffa Fixes memory leaks in GdNavigationServer and RasterizerSceneHighEndRD 2020-02-15 14:25:32 +08:00
Juan Linietsky cf8c679a23 ObjectID converted to a structure, fixes many bugs where used incorrectly as 32 bits. 2020-02-12 14:24:54 -03:00
Rémi Verschelde db81928e08 Vulkan: Move thirdparty code out of drivers, style fixes
- `vk_enum_string_helper.h` is a generated file taken from the SDK
  (Vulkan-ValidationLayers).
- `vk_mem_alloc.h` is a library from GPUOpen:
  https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator
2020-02-11 14:08:44 +01:00
Juan Linietsky 4f163972bb Refactored RID/RID_Owner to always use O(1) allocation.
* Implements a growing chunked allocator
* Removed redudant methods get and getptr, only getornull is supported now.
2020-02-11 11:53:26 +01:00
Andrea Catania e6be3f68da - Integrated NavigationServer and Navigation2DServer.
- Added Navigation Agents and Obstacles.
- Integrated Collision Avoidance.

This work has been kindly sponsored by IMVU.
2020-02-10 14:38:52 +01:00