mirror of
https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator
synced 2024-11-05 12:20:07 +00:00
parent
729b7c1408
commit
4c58c1fefe
@ -2651,8 +2651,7 @@ VmaAllocatorCreateInfo::pVulkanFunctions. Other members can be null.
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef VMA_USE_STL_SHARED_MUTEX
|
#ifndef VMA_USE_STL_SHARED_MUTEX
|
||||||
// Compiler conforms to C++17.
|
#if __cplusplus >= 201703L || _MSVC_LANG >= 201703L // C++17
|
||||||
#if __cplusplus >= 201703L
|
|
||||||
#define VMA_USE_STL_SHARED_MUTEX 1
|
#define VMA_USE_STL_SHARED_MUTEX 1
|
||||||
// Visual studio defines __cplusplus properly only when passed additional parameter: /Zc:__cplusplus
|
// Visual studio defines __cplusplus properly only when passed additional parameter: /Zc:__cplusplus
|
||||||
// Otherwise it is always 199711L, despite shared_mutex works since Visual Studio 2015 Update 2.
|
// Otherwise it is always 199711L, despite shared_mutex works since Visual Studio 2015 Update 2.
|
||||||
@ -2697,6 +2696,14 @@ remove them if not needed.
|
|||||||
#define VMA_NULL nullptr
|
#define VMA_NULL nullptr
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef VMA_FALLTHROUGH
|
||||||
|
#if __cplusplus >= 201703L || _MSVC_LANG >= 201703L // C++17
|
||||||
|
#define VMA_FALLTHROUGH [[fallthrough]]
|
||||||
|
#else
|
||||||
|
#define VMA_FALLTHROUGH
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
// Normal assert to check for programmer's errors, especially in Debug configuration.
|
// Normal assert to check for programmer's errors, especially in Debug configuration.
|
||||||
#ifndef VMA_ASSERT
|
#ifndef VMA_ASSERT
|
||||||
#ifdef NDEBUG
|
#ifdef NDEBUG
|
||||||
@ -2773,7 +2780,7 @@ static void* vma_aligned_alloc(size_t alignment, size_t size)
|
|||||||
{
|
{
|
||||||
return _aligned_malloc(size, alignment);
|
return _aligned_malloc(size, alignment);
|
||||||
}
|
}
|
||||||
#elif __cplusplus >= 201703L // Compiler conforms to C++17.
|
#elif __cplusplus >= 201703L || _MSVC_LANG >= 201703L // C++17
|
||||||
static void* vma_aligned_alloc(size_t alignment, size_t size)
|
static void* vma_aligned_alloc(size_t alignment, size_t size)
|
||||||
{
|
{
|
||||||
return aligned_alloc(alignment, size);
|
return aligned_alloc(alignment, size);
|
||||||
@ -5663,7 +5670,6 @@ void VmaJsonWriter::ContinueString(const char* pStr)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
VMA_ASSERT(0 && "Character not currently supported.");
|
VMA_ASSERT(0 && "Character not currently supported.");
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -13216,11 +13222,8 @@ VkResult VmaDefragmentationContext_T::DefragmentPassEnd(VmaDefragmentationPassMo
|
|||||||
m_PassStats.bytesFreed += freedBlockSize;
|
m_PassStats.bytesFreed += freedBlockSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (m_Algorithm)
|
if(m_Algorithm == VMA_DEFRAGMENTATION_FLAG_ALGORITHM_EXTENSIVE_BIT &&
|
||||||
{
|
m_AlgorithmState != VMA_NULL)
|
||||||
case VMA_DEFRAGMENTATION_FLAG_ALGORITHM_EXTENSIVE_BIT:
|
|
||||||
{
|
|
||||||
if (m_AlgorithmState != VMA_NULL)
|
|
||||||
{
|
{
|
||||||
// Avoid unnecessary tries to allocate when new free block is available
|
// Avoid unnecessary tries to allocate when new free block is available
|
||||||
StateExtensive& state = reinterpret_cast<StateExtensive*>(m_AlgorithmState)[vectorIndex];
|
StateExtensive& state = reinterpret_cast<StateExtensive*>(m_AlgorithmState)[vectorIndex];
|
||||||
@ -13238,8 +13241,6 @@ VkResult VmaDefragmentationContext_T::DefragmentPassEnd(VmaDefragmentationPassMo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
moveInfo.moveCount = 0;
|
moveInfo.moveCount = 0;
|
||||||
moveInfo.pMoves = VMA_NULL;
|
moveInfo.pMoves = VMA_NULL;
|
||||||
m_Moves.clear();
|
m_Moves.clear();
|
||||||
@ -13796,6 +13797,8 @@ bool VmaDefragmentationContext_T::ComputeDefragmentation_Extensive(VmaBlockVecto
|
|||||||
vectorState.operation = StateExtensive::Operation::MoveBuffers;
|
vectorState.operation = StateExtensive::Operation::MoveBuffers;
|
||||||
bufferPresent = false;
|
bufferPresent = false;
|
||||||
otherPresent = false;
|
otherPresent = false;
|
||||||
|
|
||||||
|
VMA_FALLTHROUGH; // Fallthrough
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
@ -13820,6 +13823,8 @@ bool VmaDefragmentationContext_T::ComputeDefragmentation_Extensive(VmaBlockVecto
|
|||||||
// No more buffers to move, check all others
|
// No more buffers to move, check all others
|
||||||
vectorState.operation = StateExtensive::Operation::MoveAll;
|
vectorState.operation = StateExtensive::Operation::MoveAll;
|
||||||
otherPresent = false;
|
otherPresent = false;
|
||||||
|
|
||||||
|
VMA_FALLTHROUGH; // Fallthrough
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
@ -15570,6 +15575,7 @@ VkResult VmaAllocator_T::Map(VmaAllocation hAllocation, void** ppData)
|
|||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
VMA_FALLTHROUGH; // Fallthrough
|
||||||
case VmaAllocation_T::ALLOCATION_TYPE_DEDICATED:
|
case VmaAllocation_T::ALLOCATION_TYPE_DEDICATED:
|
||||||
return hAllocation->DedicatedAllocMap(this, ppData);
|
return hAllocation->DedicatedAllocMap(this, ppData);
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user