diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2019-02-08 19:14:45 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2019-02-08 19:14:45 +0000 |
| commit | bbb32bb91cd6158be8ae71bd48d279f10bac2b56 (patch) | |
| tree | 314a6dc0d523d859c7223f984d82b86d1a5653db /Graphics | |
| parent | Cleared interface: removed superfluous default constructors; added default me... (diff) | |
| parent | Fixed issue with counting invalid master blocks in DynamicHeap (fixed https:/... (diff) | |
| download | DiligentCore-bbb32bb91cd6158be8ae71bd48d279f10bac2b56.tar.gz DiligentCore-bbb32bb91cd6158be8ae71bd48d279f10bac2b56.zip | |
Merge branch 'master' of https://github.com/DiligentGraphics/DiligentCore.git
Diffstat (limited to 'Graphics')
| -rw-r--r-- | Graphics/GraphicsEngineNextGenBase/include/DynamicHeap.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Graphics/GraphicsEngineNextGenBase/include/DynamicHeap.h b/Graphics/GraphicsEngineNextGenBase/include/DynamicHeap.h index 52d122a3..146f00df 100644 --- a/Graphics/GraphicsEngineNextGenBase/include/DynamicHeap.h +++ b/Graphics/GraphicsEngineNextGenBase/include/DynamicHeap.h @@ -131,7 +131,7 @@ public: StaleMasterBlock (const StaleMasterBlock&) = delete; StaleMasterBlock& operator= (const StaleMasterBlock&) = delete; StaleMasterBlock& operator= ( StaleMasterBlock&&) = delete; - + StaleMasterBlock(StaleMasterBlock&& rhs)noexcept : Block (std::move(rhs.Block)), Mgr (rhs.Mgr) @@ -154,6 +154,7 @@ public: }; for(auto& Block : Blocks) { + DEV_CHECK_ERR(Block.IsValid(), "Attempting to release invalid master block"); Device.SafeReleaseDeviceObject(StaleMasterBlock{std::move(Block), this}, CmdQueueMask); } } @@ -169,10 +170,14 @@ protected: MasterBlock AllocateMasterBlock(OffsetType SizeInBytes, OffsetType Alignment) { std::lock_guard<std::mutex> Lock(m_AllocationsMgrMtx); + auto NewBlock = m_AllocationsMgr.Allocate(SizeInBytes, Alignment); #ifdef DEVELOPMENT - ++m_MasterBlockCounter; + if (NewBlock.IsValid()) + { + ++m_MasterBlockCounter; + } #endif - return m_AllocationsMgr.Allocate(SizeInBytes, Alignment); + return NewBlock; } private: |
