diff --git a/Source/Engine/Core/Types/Span.h b/Source/Engine/Core/Types/Span.h index cf508a901..9c6676550 100644 --- a/Source/Engine/Core/Types/Span.h +++ b/Source/Engine/Core/Types/Span.h @@ -39,7 +39,6 @@ public: /// /// Returns true if data is valid. /// - /// True if is valid, otherwise false. FORCE_INLINE bool IsValid() const { return _data != nullptr; @@ -48,7 +47,6 @@ public: /// /// Returns true if data is invalid. /// - /// True if is invalid, otherwise false. FORCE_INLINE bool IsInvalid() const { return _data == nullptr; @@ -57,7 +55,6 @@ public: /// /// Gets length of the data. /// - /// The amount of elements. FORCE_INLINE int32 Length() const { return _length; @@ -66,7 +63,6 @@ public: /// /// Gets the pointer to the data. /// - /// The data. FORCE_INLINE T* Get() { return _data; @@ -75,7 +71,6 @@ public: /// /// Gets the pointer to the data. /// - /// The data. FORCE_INLINE const T* Get() const { return _data; @@ -84,7 +79,6 @@ public: /// /// Gets the pointer to the data. /// - /// The data. template FORCE_INLINE U* Get() const { diff --git a/Source/Engine/Graphics/RenderTask.h b/Source/Engine/Graphics/RenderTask.h index 072a87135..343289d0a 100644 --- a/Source/Engine/Graphics/RenderTask.h +++ b/Source/Engine/Graphics/RenderTask.h @@ -470,7 +470,7 @@ API_STRUCT(NoDefault) struct RenderContextBatch /// /// The Job System labels to wait on, after draw calls collecting. /// - API_FIELD() Array> WaitLabels; + API_FIELD() Array> WaitLabels; RenderContextBatch() = default; RenderContextBatch(SceneRenderTask* task); diff --git a/Source/Engine/Renderer/RenderList.cpp b/Source/Engine/Renderer/RenderList.cpp index 7021570aa..14395cb84 100644 --- a/Source/Engine/Renderer/RenderList.cpp +++ b/Source/Engine/Renderer/RenderList.cpp @@ -40,6 +40,7 @@ namespace }; Array MemPool; + CriticalSection MemPoolLocker; } void RendererDirectionalLightData::SetupLightData(LightData* data, bool useShadow) const @@ -113,6 +114,7 @@ void RendererSkyLightData::SetupLightData(LightData* data, bool useShadow) const void* RendererAllocation::Allocate(uintptr size) { void* result = nullptr; + MemPoolLocker.Lock(); for (int32 i = 0; i < MemPool.Count(); i++) { if (MemPool[i].Size == size) @@ -122,6 +124,7 @@ void* RendererAllocation::Allocate(uintptr size) break; } } + MemPoolLocker.Unlock(); if (!result) { result = Platform::Allocate(size, 16); @@ -131,7 +134,9 @@ void* RendererAllocation::Allocate(uintptr size) void RendererAllocation::Free(void* ptr, uintptr size) { + MemPoolLocker.Lock(); MemPool.Add({ ptr, size }); + MemPoolLocker.Unlock(); } RenderList* RenderList::GetFromPool()