Merge pull request #74 from benvanik/patch-1

Adding a VmaVector constructor for C++11 compatibility
This commit is contained in:
Adam Sawicki 2019-07-26 15:14:27 +02:00 committed by GitHub
commit b3687caab2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4097,6 +4097,9 @@ public:
{
}
VmaVector(size_t count, const T& value, const AllocatorT& allocator)
: VmaVector(count, allocator) {}
VmaVector(const VmaVector<T, AllocatorT>& src) :
m_Allocator(src.m_Allocator),
m_pArray(src.m_Count ? (T*)VmaAllocateArray<T>(src.m_Allocator.m_pCallbacks, src.m_Count) : VMA_NULL),
@ -12127,7 +12130,7 @@ void VmaBlockVector::ApplyDefragmentationMovesCpu(
void* pMappedData;
};
VmaVector< BlockInfo, VmaStlAllocator<BlockInfo> >
blockInfo(blockCount, VmaStlAllocator<BlockInfo>(m_hAllocator->GetAllocationCallbacks()));
blockInfo(blockCount, BlockInfo(), VmaStlAllocator<BlockInfo>(m_hAllocator->GetAllocationCallbacks()));
memset(blockInfo.data(), 0, blockCount * sizeof(BlockInfo));
// Go over all moves. Mark blocks that are used with BLOCK_FLAG_USED.