summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/VulkanMemoryAllocator/patches
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/VulkanMemoryAllocator/patches')
-rw-r--r--src/3rdparty/VulkanMemoryAllocator/patches/0001-Avoid-compiler-warnings.patch402
-rw-r--r--src/3rdparty/VulkanMemoryAllocator/patches/0001-Disable-SRWLOCK-for-MinGW.patch26
-rw-r--r--src/3rdparty/VulkanMemoryAllocator/patches/0002-Fix-gcc8-warning.patch14
-rw-r--r--src/3rdparty/VulkanMemoryAllocator/patches/0002-Switch-back-to-the-old-VK_VERSION_-etc.-from-VK_API_.patch33
-rw-r--r--src/3rdparty/VulkanMemoryAllocator/patches/0003-Disable-some-warnings-for-gcc-and-clang.patch50
-rw-r--r--src/3rdparty/VulkanMemoryAllocator/patches/0003-Disable-srwlock-for-mingw.patch13
-rw-r--r--src/3rdparty/VulkanMemoryAllocator/patches/0004-Disable-nullability-warning-on-Apple-with-clang.patch27
-rw-r--r--src/3rdparty/VulkanMemoryAllocator/patches/0004-Make-it-compile-macos-10-15.patch46
-rw-r--r--src/3rdparty/VulkanMemoryAllocator/patches/0005-Disable-more-warnings.patch33
-rw-r--r--src/3rdparty/VulkanMemoryAllocator/patches/0006-vma-Revise-disabled-warnings.patch28
10 files changed, 197 insertions, 475 deletions
diff --git a/src/3rdparty/VulkanMemoryAllocator/patches/0001-Avoid-compiler-warnings.patch b/src/3rdparty/VulkanMemoryAllocator/patches/0001-Avoid-compiler-warnings.patch
deleted file mode 100644
index f459db6c7a..0000000000
--- a/src/3rdparty/VulkanMemoryAllocator/patches/0001-Avoid-compiler-warnings.patch
+++ /dev/null
@@ -1,402 +0,0 @@
-diff --git a/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h b/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
-index a2f7a1b..fbe6f9e 100644
---- a/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
-+++ b/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
-@@ -3661,7 +3661,7 @@ static void VmaWriteMagicValue(void* pData, VkDeviceSize offset)
- {
- uint32_t* pDst = (uint32_t*)((char*)pData + offset);
- const size_t numberCount = VMA_DEBUG_MARGIN / sizeof(uint32_t);
-- for(size_t i = 0; i < numberCount; ++i, ++pDst)
-+ for(size_t i = 0; i != numberCount; ++i, ++pDst)
- {
- *pDst = VMA_CORRUPTION_DETECTION_MAGIC_VALUE;
- }
-@@ -3671,7 +3671,7 @@ static bool VmaValidateMagicValue(const void* pData, VkDeviceSize offset)
- {
- const uint32_t* pSrc = (const uint32_t*)((const char*)pData + offset);
- const size_t numberCount = VMA_DEBUG_MARGIN / sizeof(uint32_t);
-- for(size_t i = 0; i < numberCount; ++i, ++pSrc)
-+ for(size_t i = 0; i != numberCount; ++i, ++pSrc)
- {
- if(*pSrc != VMA_CORRUPTION_DETECTION_MAGIC_VALUE)
- {
-@@ -3866,7 +3866,7 @@ public:
- template<typename U> VmaStlAllocator(const VmaStlAllocator<U>& src) : m_pCallbacks(src.m_pCallbacks) { }
-
- T* allocate(size_t n) { return VmaAllocateArray<T>(m_pCallbacks, n); }
-- void deallocate(T* p, size_t n) { VmaFree(m_pCallbacks, p); }
-+ void deallocate(T* p, size_t /*n*/) { VmaFree(m_pCallbacks, p); }
-
- template<typename U>
- bool operator==(const VmaStlAllocator<U>& rhs) const
-@@ -5214,7 +5214,7 @@ public:
- virtual void FreeAtOffset(VkDeviceSize offset) = 0;
-
- // Tries to resize (grow or shrink) space for given allocation, in place.
-- virtual bool ResizeAllocation(const VmaAllocation alloc, VkDeviceSize newSize) { return false; }
-+ virtual bool ResizeAllocation(const VmaAllocation /*alloc*/, VkDeviceSize /*newSize*/) { return false; }
-
- protected:
- const VkAllocationCallbacks* GetAllocationCallbacks() const { return m_pAllocationCallbacks; }
-@@ -5574,7 +5574,7 @@ public:
-
- virtual uint32_t MakeAllocationsLost(uint32_t currentFrameIndex, uint32_t frameInUseCount);
-
-- virtual VkResult CheckCorruption(const void* pBlockData) { return VK_ERROR_FEATURE_NOT_PRESENT; }
-+ virtual VkResult CheckCorruption(const void* /*pBlockData*/) { return VK_ERROR_FEATURE_NOT_PRESENT; }
-
- virtual void Alloc(
- const VmaAllocationRequest& request,
-@@ -6133,7 +6133,7 @@ public:
- bool overlappingMoveSupported);
- virtual ~VmaDefragmentationAlgorithm_Fast();
-
-- virtual void AddAllocation(VmaAllocation hAlloc, VkBool32* pChanged) { ++m_AllocationCount; }
-+ virtual void AddAllocation(VmaAllocation /*hAlloc*/, VkBool32* /*pChanged*/) { ++m_AllocationCount; }
- virtual void AddAll() { m_AllAllocations = true; }
-
- virtual VkResult Defragment(
-@@ -6318,7 +6318,7 @@ private:
- // Redundant, for convenience not to fetch from m_hCustomPool->m_BlockVector or m_hAllocator->m_pBlockVectors.
- VmaBlockVector* const m_pBlockVector;
- const uint32_t m_CurrFrameIndex;
-- const uint32_t m_AlgorithmFlags;
-+ /*const uint32_t m_AlgorithmFlags;*/
- // Owner of this object.
- VmaDefragmentationAlgorithm* m_pAlgorithm;
-
-@@ -7073,6 +7073,7 @@ void VmaJsonWriter::BeginValue(bool isString)
- if(currItem.type == COLLECTION_TYPE_OBJECT &&
- currItem.valueCount % 2 == 0)
- {
-+ (void) isString;
- VMA_ASSERT(isString);
- }
-
-@@ -7660,7 +7661,9 @@ bool VmaBlockMetadata_Generic::Validate() const
- }
-
- // Margin required between allocations - every free space must be at least that large.
-+#if VMA_DEBUG_MARGIN
- VMA_VALIDATE(subAlloc.size >= VMA_DEBUG_MARGIN);
-+#endif
- }
- else
- {
-@@ -7806,6 +7809,7 @@ bool VmaBlockMetadata_Generic::CreateAllocationRequest(
- {
- VMA_ASSERT(allocSize > 0);
- VMA_ASSERT(!upperAddress);
-+ (void) upperAddress;
- VMA_ASSERT(allocType != VMA_SUBALLOCATION_TYPE_FREE);
- VMA_ASSERT(pAllocationRequest != VMA_NULL);
- VMA_HEAVY_ASSERT(Validate());
-@@ -8033,6 +8037,7 @@ void VmaBlockMetadata_Generic::Alloc(
- VmaAllocation hAllocation)
- {
- VMA_ASSERT(!upperAddress);
-+ (void) upperAddress;
- VMA_ASSERT(request.item != m_Suballocations.end());
- VmaSuballocation& suballoc = *request.item;
- // Given suballocation is a free block.
-@@ -9609,7 +9614,7 @@ bool VmaBlockMetadata_Linear::CreateAllocationRequest(
- bool upperAddress,
- VmaSuballocationType allocType,
- bool canMakeOtherLost,
-- uint32_t strategy,
-+ uint32_t /*strategy*/,
- VmaAllocationRequest* pAllocationRequest)
- {
- VMA_ASSERT(allocSize > 0);
-@@ -9651,10 +9656,12 @@ bool VmaBlockMetadata_Linear::CreateAllocationRequest(
- // Apply VMA_DEBUG_MARGIN at the end.
- if(VMA_DEBUG_MARGIN > 0)
- {
-+#if VMA_DEBUG_MARGIN
- if(resultOffset < VMA_DEBUG_MARGIN)
- {
- return false;
- }
-+#endif
- resultOffset -= VMA_DEBUG_MARGIN;
- }
-
-@@ -10542,18 +10549,19 @@ void VmaBlockMetadata_Buddy::PrintDetailedMap(class VmaJsonWriter& json) const
- #endif // #if VMA_STATS_STRING_ENABLED
-
- bool VmaBlockMetadata_Buddy::CreateAllocationRequest(
-- uint32_t currentFrameIndex,
-- uint32_t frameInUseCount,
-+ uint32_t /*currentFrameIndex*/,
-+ uint32_t /*frameInUseCount*/,
- VkDeviceSize bufferImageGranularity,
- VkDeviceSize allocSize,
- VkDeviceSize allocAlignment,
- bool upperAddress,
- VmaSuballocationType allocType,
-- bool canMakeOtherLost,
-- uint32_t strategy,
-+ bool /*canMakeOtherLost*/,
-+ uint32_t /*strategy*/,
- VmaAllocationRequest* pAllocationRequest)
- {
- VMA_ASSERT(!upperAddress && "VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT can be used only with linear algorithm.");
-+ (void) upperAddress;
-
- // Simple way to respect bufferImageGranularity. May be optimized some day.
- // Whenever it might be an OPTIMAL image...
-@@ -10593,8 +10601,8 @@ bool VmaBlockMetadata_Buddy::CreateAllocationRequest(
- }
-
- bool VmaBlockMetadata_Buddy::MakeRequestedAllocationsLost(
-- uint32_t currentFrameIndex,
-- uint32_t frameInUseCount,
-+ uint32_t /*currentFrameIndex*/,
-+ uint32_t /*frameInUseCount*/,
- VmaAllocationRequest* pAllocationRequest)
- {
- /*
-@@ -10604,7 +10612,7 @@ bool VmaBlockMetadata_Buddy::MakeRequestedAllocationsLost(
- return pAllocationRequest->itemsToMakeLostCount == 0;
- }
-
--uint32_t VmaBlockMetadata_Buddy::MakeAllocationsLost(uint32_t currentFrameIndex, uint32_t frameInUseCount)
-+uint32_t VmaBlockMetadata_Buddy::MakeAllocationsLost(uint32_t /*currentFrameIndex*/, uint32_t /*frameInUseCount*/)
- {
- /*
- Lost allocations are not supported in buddy allocator at the moment.
-@@ -10615,9 +10623,9 @@ uint32_t VmaBlockMetadata_Buddy::MakeAllocationsLost(uint32_t currentFrameIndex,
-
- void VmaBlockMetadata_Buddy::Alloc(
- const VmaAllocationRequest& request,
-- VmaSuballocationType type,
-+ VmaSuballocationType /*type*/,
- VkDeviceSize allocSize,
-- bool upperAddress,
-+ bool /*upperAddress*/,
- VmaAllocation hAllocation)
- {
- const uint32_t targetLevel = AllocSizeToLevel(allocSize);
-@@ -10941,7 +10949,7 @@ void VmaBlockMetadata_Buddy::PrintDetailedMapNode(class VmaJsonWriter& json, con
- ////////////////////////////////////////////////////////////////////////////////
- // class VmaDeviceMemoryBlock
-
--VmaDeviceMemoryBlock::VmaDeviceMemoryBlock(VmaAllocator hAllocator) :
-+VmaDeviceMemoryBlock::VmaDeviceMemoryBlock(VmaAllocator /*hAllocator*/) :
- m_pMetadata(VMA_NULL),
- m_MemoryTypeIndex(UINT32_MAX),
- m_Id(0),
-@@ -11691,6 +11699,7 @@ VkResult VmaBlockVector::AllocatePage(
- if(IsCorruptionDetectionEnabled())
- {
- VkResult res = pBestRequestBlock->WriteMagicValueAroundAllocation(m_hAllocator, bestRequest.offset, size);
-+ (void) res;
- VMA_ASSERT(res == VK_SUCCESS && "Couldn't map block memory to write magic value.");
- }
- return VK_SUCCESS;
-@@ -11729,6 +11738,7 @@ void VmaBlockVector::Free(
- if(IsCorruptionDetectionEnabled())
- {
- VkResult res = pBlock->ValidateMagicValueAroundAllocation(m_hAllocator, hAllocation->GetOffset(), hAllocation->GetSize());
-+ (void) res;
- VMA_ASSERT(res == VK_SUCCESS && "Couldn't map block memory to validate magic value.");
- }
-
-@@ -11894,6 +11904,7 @@ VkResult VmaBlockVector::AllocateFromBlock(
- if(IsCorruptionDetectionEnabled())
- {
- VkResult res = pBlock->WriteMagicValueAroundAllocation(m_hAllocator, currRequest.offset, size);
-+ (void) res;
- VMA_ASSERT(res == VK_SUCCESS && "Couldn't map block memory to write magic value.");
- }
- return VK_SUCCESS;
-@@ -11903,7 +11914,8 @@ VkResult VmaBlockVector::AllocateFromBlock(
-
- VkResult VmaBlockVector::CreateBlock(VkDeviceSize blockSize, size_t* pNewBlockIndex)
- {
-- VkMemoryAllocateInfo allocInfo = { VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO };
-+ VkMemoryAllocateInfo allocInfo = {};
-+ allocInfo.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO;
- allocInfo.memoryTypeIndex = m_MemoryTypeIndex;
- allocInfo.allocationSize = blockSize;
- VkDeviceMemory mem = VK_NULL_HANDLE;
-@@ -11991,7 +12003,8 @@ void VmaBlockVector::ApplyDefragmentationMovesCpu(
- if(pDefragCtx->res == VK_SUCCESS)
- {
- const VkDeviceSize nonCoherentAtomSize = m_hAllocator->m_PhysicalDeviceProperties.limits.nonCoherentAtomSize;
-- VkMappedMemoryRange memRange = { VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE };
-+ VkMappedMemoryRange memRange = {};
-+ memRange.sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE;
-
- for(size_t moveIndex = 0; moveIndex < moveCount; ++moveIndex)
- {
-@@ -12076,7 +12089,8 @@ void VmaBlockVector::ApplyDefragmentationMovesGpu(
-
- // Go over all blocks. Create and bind buffer for whole block if necessary.
- {
-- VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
-+ VkBufferCreateInfo bufCreateInfo = {};
-+ bufCreateInfo.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO;
- bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT |
- VK_BUFFER_USAGE_TRANSFER_DST_BIT;
-
-@@ -12101,8 +12115,9 @@ void VmaBlockVector::ApplyDefragmentationMovesGpu(
- // Go over all moves. Post data transfer commands to command buffer.
- if(pDefragCtx->res == VK_SUCCESS)
- {
-- const VkDeviceSize nonCoherentAtomSize = m_hAllocator->m_PhysicalDeviceProperties.limits.nonCoherentAtomSize;
-- VkMappedMemoryRange memRange = { VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE };
-+ /*const VkDeviceSize nonCoherentAtomSize = m_hAllocator->m_PhysicalDeviceProperties.limits.nonCoherentAtomSize;
-+ VkMappedMemoryRange memRange = {};
-+ memRange.sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE;*/
-
- for(size_t moveIndex = 0; moveIndex < moveCount; ++moveIndex)
- {
-@@ -12435,10 +12450,10 @@ VmaDefragmentationAlgorithm_Generic::VmaDefragmentationAlgorithm_Generic(
- VmaAllocator hAllocator,
- VmaBlockVector* pBlockVector,
- uint32_t currentFrameIndex,
-- bool overlappingMoveSupported) :
-+ bool /*overlappingMoveSupported*/) :
- VmaDefragmentationAlgorithm(hAllocator, pBlockVector, currentFrameIndex),
-- m_AllAllocations(false),
- m_AllocationCount(0),
-+ m_AllAllocations(false),
- m_BytesMoved(0),
- m_AllocationsMoved(0),
- m_Blocks(VmaStlAllocator<BlockInfo*>(hAllocator->GetAllocationCallbacks()))
-@@ -12813,7 +12828,7 @@ VkResult VmaDefragmentationAlgorithm_Fast::Defragment(
- size_t freeSpaceOrigBlockIndex = m_BlockInfos[freeSpaceInfoIndex].origBlockIndex;
- VmaDeviceMemoryBlock* pFreeSpaceBlock = m_pBlockVector->GetBlock(freeSpaceOrigBlockIndex);
- VmaBlockMetadata_Generic* pFreeSpaceMetadata = (VmaBlockMetadata_Generic*)pFreeSpaceBlock->m_pMetadata;
-- VkDeviceSize freeSpaceBlockSize = pFreeSpaceMetadata->GetSize();
-+ /*VkDeviceSize freeSpaceBlockSize = pFreeSpaceMetadata->GetSize();*/
-
- // Same block
- if(freeSpaceInfoIndex == srcBlockInfoIndex)
-@@ -13098,7 +13113,7 @@ VmaBlockVectorDefragmentationContext::VmaBlockVectorDefragmentationContext(
- VmaPool hCustomPool,
- VmaBlockVector* pBlockVector,
- uint32_t currFrameIndex,
-- uint32_t algorithmFlags) :
-+ uint32_t /*algorithmFlags*/) :
- res(VK_SUCCESS),
- mutexLocked(false),
- blockContexts(VmaStlAllocator<VmaBlockDefragmentationContext>(hAllocator->GetAllocationCallbacks())),
-@@ -13106,7 +13121,7 @@ VmaBlockVectorDefragmentationContext::VmaBlockVectorDefragmentationContext(
- m_hCustomPool(hCustomPool),
- m_pBlockVector(pBlockVector),
- m_CurrFrameIndex(currFrameIndex),
-- m_AlgorithmFlags(algorithmFlags),
-+ /*m_AlgorithmFlags(algorithmFlags),*/
- m_pAlgorithm(VMA_NULL),
- m_Allocations(VmaStlAllocator<AllocInfo>(hAllocator->GetAllocationCallbacks())),
- m_AllAllocations(false)
-@@ -14311,19 +14326,21 @@ VkResult VmaAllocator_T::AllocateDedicatedMemory(
- bool map,
- bool isUserDataString,
- void* pUserData,
-- VkBuffer dedicatedBuffer,
-- VkImage dedicatedImage,
-+ VkBuffer /*dedicatedBuffer*/,
-+ VkImage /*dedicatedImage*/,
- size_t allocationCount,
- VmaAllocation* pAllocations)
- {
- VMA_ASSERT(allocationCount > 0 && pAllocations);
-
-- VkMemoryAllocateInfo allocInfo = { VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO };
-+ VkMemoryAllocateInfo allocInfo = {};
-+ allocInfo.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO;
- allocInfo.memoryTypeIndex = memTypeIndex;
- allocInfo.allocationSize = size;
-
- #if VMA_DEDICATED_ALLOCATION
-- VkMemoryDedicatedAllocateInfoKHR dedicatedAllocInfo = { VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR };
-+ VkMemoryDedicatedAllocateInfoKHR dedicatedAllocInfo = {};
-+ dedicatedAllocInfo.sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR;
- if(m_UseKhrDedicatedAllocation)
- {
- if(dedicatedBuffer != VK_NULL_HANDLE)
-@@ -14341,7 +14358,7 @@ VkResult VmaAllocator_T::AllocateDedicatedMemory(
- #endif // #if VMA_DEDICATED_ALLOCATION
-
- size_t allocIndex;
-- VkResult res;
-+ VkResult res = VK_SUCCESS;
- for(allocIndex = 0; allocIndex < allocationCount; ++allocIndex)
- {
- res = AllocateDedicatedMemoryPage(
-@@ -14460,12 +14477,15 @@ void VmaAllocator_T::GetBufferMemoryRequirements(
- #if VMA_DEDICATED_ALLOCATION
- if(m_UseKhrDedicatedAllocation)
- {
-- VkBufferMemoryRequirementsInfo2KHR memReqInfo = { VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2_KHR };
-+ VkBufferMemoryRequirementsInfo2KHR memReqInfo = {};
-+ memReqInfo.sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2_KHR;
- memReqInfo.buffer = hBuffer;
-
-- VkMemoryDedicatedRequirementsKHR memDedicatedReq = { VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR };
-+ VkMemoryDedicatedRequirementsKHR memDedicatedReq = {};
-+ memDedicatedReq.sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR;
-
-- VkMemoryRequirements2KHR memReq2 = { VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR };
-+ VkMemoryRequirements2KHR memReq2 = {};
-+ memReq2.sType = VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR;
- memReq2.pNext = &memDedicatedReq;
-
- (*m_VulkanFunctions.vkGetBufferMemoryRequirements2KHR)(m_hDevice, &memReqInfo, &memReq2);
-@@ -14492,12 +14512,15 @@ void VmaAllocator_T::GetImageMemoryRequirements(
- #if VMA_DEDICATED_ALLOCATION
- if(m_UseKhrDedicatedAllocation)
- {
-- VkImageMemoryRequirementsInfo2KHR memReqInfo = { VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2_KHR };
-+ VkImageMemoryRequirementsInfo2KHR memReqInfo = {};
-+ memReqInfo.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2_KHR;
- memReqInfo.image = hImage;
-
-- VkMemoryDedicatedRequirementsKHR memDedicatedReq = { VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR };
-+ VkMemoryDedicatedRequirementsKHR memDedicatedReq = {};
-+ memDedicatedReq.sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR;
-
-- VkMemoryRequirements2KHR memReq2 = { VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR };
-+ VkMemoryRequirements2KHR memReq2 = {};
-+ memReq2.sType = VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR;
- memReq2.pNext = &memDedicatedReq;
-
- (*m_VulkanFunctions.vkGetImageMemoryRequirements2KHR)(m_hDevice, &memReqInfo, &memReq2);
-@@ -14734,7 +14757,7 @@ VkResult VmaAllocator_T::ResizeAllocation(
- }
- else
- {
-- return VK_ERROR_OUT_OF_POOL_MEMORY;
-+ return VkResult(-1000069000); // VK_ERROR_OUT_OF_POOL_MEMORY
- }
- default:
- VMA_ASSERT(0);
-@@ -15000,6 +15023,7 @@ void VmaAllocator_T::DestroyPool(VmaPool pool)
- {
- VmaMutexLockWrite lock(m_PoolsMutex, m_UseMutex);
- bool success = VmaVectorRemoveSorted<VmaPointerLess>(m_Pools, pool);
-+ (void) success;
- VMA_ASSERT(success && "Pool not found in Allocator.");
- }
-
-@@ -15248,7 +15272,8 @@ void VmaAllocator_T::FlushOrInvalidateAllocation(
-
- const VkDeviceSize nonCoherentAtomSize = m_PhysicalDeviceProperties.limits.nonCoherentAtomSize;
-
-- VkMappedMemoryRange memRange = { VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE };
-+ VkMappedMemoryRange memRange = {};
-+ memRange.sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE;
- memRange.memory = hAllocation->GetMemory();
-
- switch(hAllocation->GetType())
-@@ -15321,6 +15346,7 @@ void VmaAllocator_T::FreeDedicatedMemory(VmaAllocation allocation)
- AllocationVectorType* const pDedicatedAllocations = m_pDedicatedAllocations[memTypeIndex];
- VMA_ASSERT(pDedicatedAllocations);
- bool success = VmaVectorRemoveSorted<VmaPointerLess>(*pDedicatedAllocations, allocation);
-+ (void) success;
- VMA_ASSERT(success);
- }
-
diff --git a/src/3rdparty/VulkanMemoryAllocator/patches/0001-Disable-SRWLOCK-for-MinGW.patch b/src/3rdparty/VulkanMemoryAllocator/patches/0001-Disable-SRWLOCK-for-MinGW.patch
new file mode 100644
index 0000000000..8d5b50e7bc
--- /dev/null
+++ b/src/3rdparty/VulkanMemoryAllocator/patches/0001-Disable-SRWLOCK-for-MinGW.patch
@@ -0,0 +1,26 @@
+From 1e4a10230381acc79768fd577987dde4255d6148 Mon Sep 17 00:00:00 2001
+From: Laszlo Agocs <laszlo.agocs@qt.io>
+Date: Thu, 14 Jan 2021 11:22:09 +0100
+Subject: [PATCH 1/4] Disable SRWLOCK for MinGW
+
+Change-Id: Ie671e7bcf88ef28eb177a6fba17964a5e8ae30c0
+---
+ src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h b/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
+index 0dfb66efc6..8e579967d9 100644
+--- a/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
++++ b/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
+@@ -3691,7 +3691,7 @@ void *aligned_alloc(size_t alignment, size_t size)
+ std::shared_mutex m_Mutex;
+ };
+ #define VMA_RW_MUTEX VmaRWMutex
+- #elif defined(_WIN32) && defined(WINVER) && WINVER >= 0x0600
++ #elif defined(_WIN32) && defined(WINVER) && WINVER >= 0x0600 && !defined(__MINGW32__)
+ // Use SRWLOCK from WinAPI.
+ // Minimum supported client = Windows Vista, server = Windows Server 2008.
+ class VmaRWMutex
+--
+2.23.0.windows.1
+
diff --git a/src/3rdparty/VulkanMemoryAllocator/patches/0002-Fix-gcc8-warning.patch b/src/3rdparty/VulkanMemoryAllocator/patches/0002-Fix-gcc8-warning.patch
deleted file mode 100644
index 57a2f1a0f1..0000000000
--- a/src/3rdparty/VulkanMemoryAllocator/patches/0002-Fix-gcc8-warning.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff --git a/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h b/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
-index fbe6f9e3e8..f043bdc289 100644
---- a/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
-+++ b/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
-@@ -12074,7 +12074,8 @@ void VmaBlockVector::ApplyDefragmentationMovesGpu(
- const size_t blockCount = m_Blocks.size();
-
- pDefragCtx->blockContexts.resize(blockCount);
-- memset(pDefragCtx->blockContexts.data(), 0, blockCount * sizeof(VmaBlockDefragmentationContext));
-+ for (size_t i = 0; i < blockCount; ++i)
-+ pDefragCtx->blockContexts[i] = VmaBlockDefragmentationContext();
-
- // Go over all moves. Mark blocks that are used with BLOCK_FLAG_USED.
- const size_t moveCount = moves.size();
diff --git a/src/3rdparty/VulkanMemoryAllocator/patches/0002-Switch-back-to-the-old-VK_VERSION_-etc.-from-VK_API_.patch b/src/3rdparty/VulkanMemoryAllocator/patches/0002-Switch-back-to-the-old-VK_VERSION_-etc.-from-VK_API_.patch
new file mode 100644
index 0000000000..631976cd81
--- /dev/null
+++ b/src/3rdparty/VulkanMemoryAllocator/patches/0002-Switch-back-to-the-old-VK_VERSION_-etc.-from-VK_API_.patch
@@ -0,0 +1,33 @@
+From 81ec04850473efe01ffdc5bc9383272e77f8cc4e Mon Sep 17 00:00:00 2001
+From: Laszlo Agocs <laszlo.agocs@qt.io>
+Date: Mon, 17 Oct 2022 14:14:12 +0200
+Subject: [PATCH] Switch back to the old VK_VERSION_* etc. from
+ VK_API_VERSION_*
+
+Change-Id: I412ff542ddda895a837c34c4ca40fb4845eae2ba
+---
+ src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h b/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
+index 02de45fa1c..ef3ad65060 100644
+--- a/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
++++ b/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
+@@ -16114,11 +16114,11 @@ VMA_CALL_PRE void VMA_CALL_POST vmaBuildStatsString(
+
+ json.WriteString("apiVersion");
+ json.BeginString();
+- json.ContinueString(VK_API_VERSION_MAJOR(deviceProperties.apiVersion));
++ json.ContinueString(VK_VERSION_MAJOR(deviceProperties.apiVersion));
+ json.ContinueString(".");
+- json.ContinueString(VK_API_VERSION_MINOR(deviceProperties.apiVersion));
++ json.ContinueString(VK_VERSION_MINOR(deviceProperties.apiVersion));
+ json.ContinueString(".");
+- json.ContinueString(VK_API_VERSION_PATCH(deviceProperties.apiVersion));
++ json.ContinueString(VK_VERSION_PATCH(deviceProperties.apiVersion));
+ json.EndString();
+
+ json.WriteString("GPU");
+--
+2.36.1.windows.1
+
diff --git a/src/3rdparty/VulkanMemoryAllocator/patches/0003-Disable-some-warnings-for-gcc-and-clang.patch b/src/3rdparty/VulkanMemoryAllocator/patches/0003-Disable-some-warnings-for-gcc-and-clang.patch
new file mode 100644
index 0000000000..b1476a4032
--- /dev/null
+++ b/src/3rdparty/VulkanMemoryAllocator/patches/0003-Disable-some-warnings-for-gcc-and-clang.patch
@@ -0,0 +1,50 @@
+From aca24b15fbb6b47c35cbd7cd31a3db840df52ded Mon Sep 17 00:00:00 2001
+From: Laszlo Agocs <laszlo.agocs@qt.io>
+Date: Mon, 17 Oct 2022 16:33:50 +0200
+Subject: [PATCH] Disable some warnings for gcc and clang
+
+Change-Id: I81c6c5a2ce736846b6fd95c7f66b7946f7357cf2
+---
+ .../VulkanMemoryAllocator/vk_mem_alloc.h | 19 +++++++++++++++++++
+ 1 file changed, 19 insertions(+)
+
+diff --git a/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h b/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
+index ef3ad65060..2a5b1e4b1a 100644
+--- a/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
++++ b/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
+@@ -2565,6 +2565,18 @@ VMA_CALL_PRE void VMA_CALL_POST vmaFreeStatsString(
+ #ifdef VMA_IMPLEMENTATION
+ #undef VMA_IMPLEMENTATION
+
++#if defined(__GNUC__) && !defined(__clang__)
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wunused-variable"
++#pragma GCC diagnostic ignored "-Wunused-parameter"
++#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
++#elif defined(__clang__)
++#pragma clang diagnostic push
++#pragma clang diagnostic ignored "-Wunused-variable"
++#pragma clang diagnostic ignored "-Wunused-parameter"
++#pragma clang diagnostic ignored "-Wmissing-field-initializers"
++#endif
++
+ #include <cstdint>
+ #include <cstdlib>
+ #include <cstring>
+@@ -17526,6 +17538,13 @@ VMA_CALL_PRE void VMA_CALL_POST vmaFreeVirtualBlockStatsString(VmaVirtualBlock V
+ }
+ #endif // VMA_STATS_STRING_ENABLED
+ #endif // _VMA_PUBLIC_INTERFACE
++
++#if defined(__GNUC__) && !defined(__clang__)
++#pragma GCC diagnostic pop
++#elif defined(__clang__)
++#pragma clang diagnostic pop
++#endif
++
+ #endif // VMA_IMPLEMENTATION
+
+ /**
+--
+2.36.1.windows.1
+
diff --git a/src/3rdparty/VulkanMemoryAllocator/patches/0003-Disable-srwlock-for-mingw.patch b/src/3rdparty/VulkanMemoryAllocator/patches/0003-Disable-srwlock-for-mingw.patch
deleted file mode 100644
index ab7acfe40b..0000000000
--- a/src/3rdparty/VulkanMemoryAllocator/patches/0003-Disable-srwlock-for-mingw.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h b/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
-index f043bdc289..2355de091f 100644
---- a/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
-+++ b/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
-@@ -3298,7 +3298,7 @@ void *aligned_alloc(size_t alignment, size_t size)
- std::shared_mutex m_Mutex;
- };
- #define VMA_RW_MUTEX VmaRWMutex
-- #elif defined(_WIN32)
-+ #elif defined(_WIN32) && !defined(__MINGW32__)
- // Use SRWLOCK from WinAPI.
- class VmaRWMutex
- {
diff --git a/src/3rdparty/VulkanMemoryAllocator/patches/0004-Disable-nullability-warning-on-Apple-with-clang.patch b/src/3rdparty/VulkanMemoryAllocator/patches/0004-Disable-nullability-warning-on-Apple-with-clang.patch
new file mode 100644
index 0000000000..685764a65e
--- /dev/null
+++ b/src/3rdparty/VulkanMemoryAllocator/patches/0004-Disable-nullability-warning-on-Apple-with-clang.patch
@@ -0,0 +1,27 @@
+From 1d0c960caba0b5aa7e686deafd455d4a3c84db49 Mon Sep 17 00:00:00 2001
+From: Laszlo Agocs <laszlo.agocs@qt.io>
+Date: Tue, 18 Oct 2022 13:26:38 +0200
+Subject: [PATCH] Disable nullability warning on Apple with clang
+
+Change-Id: I6602d1cb695d6483177d3c3722b468a0c9df235a
+---
+ src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h b/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
+index 2a5b1e4b1a..18081839c0 100644
+--- a/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
++++ b/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
+@@ -2575,6 +2575,9 @@ VMA_CALL_PRE void VMA_CALL_POST vmaFreeStatsString(
+ #pragma clang diagnostic ignored "-Wunused-variable"
+ #pragma clang diagnostic ignored "-Wunused-parameter"
+ #pragma clang diagnostic ignored "-Wmissing-field-initializers"
++#if defined(__APPLE__)
++#pragma clang diagnostic ignored "-Wnullability-completeness"
++#endif
+ #endif
+
+ #include <cstdint>
+--
+2.37.0 (Apple Git-136)
+
diff --git a/src/3rdparty/VulkanMemoryAllocator/patches/0004-Make-it-compile-macos-10-15.patch b/src/3rdparty/VulkanMemoryAllocator/patches/0004-Make-it-compile-macos-10-15.patch
deleted file mode 100644
index 1da4b0feae..0000000000
--- a/src/3rdparty/VulkanMemoryAllocator/patches/0004-Make-it-compile-macos-10-15.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-diff --git a/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h b/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
-index 2355de091f..5d311b750d 100644
---- a/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
-+++ b/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
-@@ -3167,7 +3167,7 @@ void *aligned_alloc(size_t alignment, size_t size)
-
- return memalign(alignment, size);
- }
--#elif defined(__APPLE__) || defined(__ANDROID__)
-+#elif defined(__ANDROID__)
- #include <cstdlib>
- void *aligned_alloc(size_t alignment, size_t size)
- {
-@@ -3182,6 +3182,23 @@ void *aligned_alloc(size_t alignment, size_t size)
- return pointer;
- return VMA_NULL;
- }
-+#elif defined(__APPLE__)
-+#include <cstdlib>
-+// aligned_alloc() is marked as macOS 10.15 only in the 10.15 SDK,
-+// avoid the mess by using a different name
-+void *vma_aligned_alloc(size_t alignment, size_t size)
-+{
-+ // alignment must be >= sizeof(void*)
-+ if(alignment < sizeof(void*))
-+ {
-+ alignment = sizeof(void*);
-+ }
-+
-+ void *pointer;
-+ if(posix_memalign(&pointer, alignment, size) == 0)
-+ return pointer;
-+ return VMA_NULL;
-+}
- #endif
-
- // If your compiler is not compatible with C++11 and definition of
-@@ -3215,6 +3232,8 @@ void *aligned_alloc(size_t alignment, size_t size)
- #ifndef VMA_SYSTEM_ALIGNED_MALLOC
- #if defined(_WIN32)
- #define VMA_SYSTEM_ALIGNED_MALLOC(size, alignment) (_aligned_malloc((size), (alignment)))
-+ #elif defined(__APPLE__)
-+ #define VMA_SYSTEM_ALIGNED_MALLOC(size, alignment) (vma_aligned_alloc((alignment), (size) ))
- #else
- #define VMA_SYSTEM_ALIGNED_MALLOC(size, alignment) (aligned_alloc((alignment), (size) ))
- #endif
diff --git a/src/3rdparty/VulkanMemoryAllocator/patches/0005-Disable-more-warnings.patch b/src/3rdparty/VulkanMemoryAllocator/patches/0005-Disable-more-warnings.patch
new file mode 100644
index 0000000000..f6ac509039
--- /dev/null
+++ b/src/3rdparty/VulkanMemoryAllocator/patches/0005-Disable-more-warnings.patch
@@ -0,0 +1,33 @@
+From 4a6d29420041e1f0a14450853887226ff838b917 Mon Sep 17 00:00:00 2001
+From: Laszlo Agocs <laszlo.agocs@qt.io>
+Date: Mon, 24 Oct 2022 15:11:30 +0200
+Subject: [PATCH] vkmemalloc: Disable more warnings
+
+Change-Id: Ifedd263cb39ebad6babdab7687a22ad23f2c9471
+---
+ src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h b/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
+index 18081839c0..1b27eeac16 100644
+--- a/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
++++ b/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
+@@ -2570,11 +2570,15 @@ VMA_CALL_PRE void VMA_CALL_POST vmaFreeStatsString(
+ #pragma GCC diagnostic ignored "-Wunused-variable"
+ #pragma GCC diagnostic ignored "-Wunused-parameter"
+ #pragma GCC diagnostic ignored "-Wmissing-field-initializers"
++#pragma GCC diagnostic ignored "-Wparentheses"
++#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
+ #elif defined(__clang__)
+ #pragma clang diagnostic push
+ #pragma clang diagnostic ignored "-Wunused-variable"
+ #pragma clang diagnostic ignored "-Wunused-parameter"
+ #pragma clang diagnostic ignored "-Wmissing-field-initializers"
++#pragma clang diagnostic ignored "-Wparentheses"
++#pragma clang diagnostic ignored "-Wimplicit-fallthrough"
+ #if defined(__APPLE__)
+ #pragma clang diagnostic ignored "-Wnullability-completeness"
+ #endif
+--
+2.36.1.windows.1
+
diff --git a/src/3rdparty/VulkanMemoryAllocator/patches/0006-vma-Revise-disabled-warnings.patch b/src/3rdparty/VulkanMemoryAllocator/patches/0006-vma-Revise-disabled-warnings.patch
new file mode 100644
index 0000000000..3ed9b31e9c
--- /dev/null
+++ b/src/3rdparty/VulkanMemoryAllocator/patches/0006-vma-Revise-disabled-warnings.patch
@@ -0,0 +1,28 @@
+From 48762c18eb8a1430540214a6c1cb4572cc108a05 Mon Sep 17 00:00:00 2001
+From: Laszlo Agocs <laszlo.agocs@qt.io>
+Date: Wed, 26 Oct 2022 10:46:48 +0200
+Subject: [PATCH] vma: Revise disabled warnings
+
+Change-Id: I92f62022329ded94778b1385e72336ef9376baee
+---
+ src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h b/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
+index 1b27eeac16..b8f9ab52aa 100644
+--- a/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
++++ b/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
+@@ -2579,10 +2579,8 @@ VMA_CALL_PRE void VMA_CALL_POST vmaFreeStatsString(
+ #pragma clang diagnostic ignored "-Wmissing-field-initializers"
+ #pragma clang diagnostic ignored "-Wparentheses"
+ #pragma clang diagnostic ignored "-Wimplicit-fallthrough"
+-#if defined(__APPLE__)
+ #pragma clang diagnostic ignored "-Wnullability-completeness"
+ #endif
+-#endif
+
+ #include <cstdint>
+ #include <cstdlib>
+--
+2.37.3
+