summaryrefslogtreecommitdiffstats
path: root/Graphics
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2019-02-08 19:14:45 +0000
committerEgor Yusov <egor.yusov@gmail.com>2019-02-08 19:14:45 +0000
commitbbb32bb91cd6158be8ae71bd48d279f10bac2b56 (patch)
tree314a6dc0d523d859c7223f984d82b86d1a5653db /Graphics
parentCleared interface: removed superfluous default constructors; added default me... (diff)
parentFixed issue with counting invalid master blocks in DynamicHeap (fixed https:/... (diff)
downloadDiligentCore-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.h11
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: