mirror of
https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator
synced 2024-11-21 20:00:11 +00:00
Removed unused functions VmaQuickSort, VmaQuickSortPartition
Closes #262. Thanks @laurelkeys !
This commit is contained in:
parent
71b4c18344
commit
0bbde1750e
@ -3377,44 +3377,6 @@ static inline bool VmaStrIsEmpty(const char* pStr)
|
||||
return pStr == VMA_NULL || *pStr == '\0';
|
||||
}
|
||||
|
||||
#ifndef VMA_SORT
|
||||
template<typename Iterator, typename Compare>
|
||||
Iterator VmaQuickSortPartition(Iterator beg, Iterator end, Compare cmp)
|
||||
{
|
||||
Iterator centerValue = end; --centerValue;
|
||||
Iterator insertIndex = beg;
|
||||
for (Iterator memTypeIndex = beg; memTypeIndex < centerValue; ++memTypeIndex)
|
||||
{
|
||||
if (cmp(*memTypeIndex, *centerValue))
|
||||
{
|
||||
if (insertIndex != memTypeIndex)
|
||||
{
|
||||
VMA_SWAP(*memTypeIndex, *insertIndex);
|
||||
}
|
||||
++insertIndex;
|
||||
}
|
||||
}
|
||||
if (insertIndex != centerValue)
|
||||
{
|
||||
VMA_SWAP(*insertIndex, *centerValue);
|
||||
}
|
||||
return insertIndex;
|
||||
}
|
||||
|
||||
template<typename Iterator, typename Compare>
|
||||
void VmaQuickSort(Iterator beg, Iterator end, Compare cmp)
|
||||
{
|
||||
if (beg < end)
|
||||
{
|
||||
Iterator it = VmaQuickSortPartition<Iterator, Compare>(beg, end, cmp);
|
||||
VmaQuickSort<Iterator, Compare>(beg, it, cmp);
|
||||
VmaQuickSort<Iterator, Compare>(it + 1, end, cmp);
|
||||
}
|
||||
}
|
||||
|
||||
#define VMA_SORT(beg, end, cmp) VmaQuickSort(beg, end, cmp)
|
||||
#endif // VMA_SORT
|
||||
|
||||
/*
|
||||
Returns true if two memory blocks occupy overlapping pages.
|
||||
ResourceA must be in less memory offset than ResourceB.
|
||||
|
Loading…
Reference in New Issue
Block a user