mirror of
https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git
synced 2024-11-23 07:14:34 +00:00
Adding a VmaVector constructor for C++11 compatibility
The std::vector constructor used (count + allocator) is only available in C++14 (see: https://en.cppreference.com/w/cpp/container/vector/vector) and compiling with C++11 and `VMA_USE_STL_VECTOR` will result in compile errors. This adds a new constructor and switches to using that for compatibility.
This commit is contained in:
parent
c7e5f2e44a
commit
fd5077cd36
@ -4097,6 +4097,9 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VmaVector(size_t count, const T& value, const AllocatorT& allocator)
|
||||||
|
: VmaVector(count, allocator) {}
|
||||||
|
|
||||||
VmaVector(const VmaVector<T, AllocatorT>& src) :
|
VmaVector(const VmaVector<T, AllocatorT>& src) :
|
||||||
m_Allocator(src.m_Allocator),
|
m_Allocator(src.m_Allocator),
|
||||||
m_pArray(src.m_Count ? (T*)VmaAllocateArray<T>(src.m_Allocator.m_pCallbacks, src.m_Count) : VMA_NULL),
|
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;
|
void* pMappedData;
|
||||||
};
|
};
|
||||||
VmaVector< BlockInfo, VmaStlAllocator<BlockInfo> >
|
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));
|
memset(blockInfo.data(), 0, blockCount * sizeof(BlockInfo));
|
||||||
|
|
||||||
// Go over all moves. Mark blocks that are used with BLOCK_FLAG_USED.
|
// Go over all moves. Mark blocks that are used with BLOCK_FLAG_USED.
|
||||||
|
Loading…
Reference in New Issue
Block a user