Minor fix: Add missing mutex lock to VmaBlockVector::IsEmpty

This commit is contained in:
Adam Sawicki 2019-11-26 11:48:06 +01:00
parent 6d6b0672b5
commit 023976ad24

View File

@ -6265,7 +6265,7 @@ public:
void GetPoolStats(VmaPoolStats* pStats); void GetPoolStats(VmaPoolStats* pStats);
bool IsEmpty() const { return m_Blocks.empty(); } bool IsEmpty();
bool IsCorruptionDetectionEnabled() const; bool IsCorruptionDetectionEnabled() const;
VkResult Allocate( VkResult Allocate(
@ -11814,6 +11814,12 @@ void VmaBlockVector::GetPoolStats(VmaPoolStats* pStats)
} }
} }
bool VmaBlockVector::IsEmpty()
{
VmaMutexLockRead lock(m_Mutex, m_hAllocator->m_UseMutex);
return m_Blocks.empty();
}
bool VmaBlockVector::IsCorruptionDetectionEnabled() const bool VmaBlockVector::IsCorruptionDetectionEnabled() const
{ {
const uint32_t requiredMemFlags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT; const uint32_t requiredMemFlags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;