summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/VulkanMemoryAllocator/patches/0005-More-MingW-8.1-warning-workarounds.patch
blob: 1549f22d18593e201f31d7614773e94a3f0e2ca3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
From e4cf9a73270f586ed15fcd899f3b8f7c0a3253b8 Mon Sep 17 00:00:00 2001
From: Laszlo Agocs <laszlo.agocs@qt.io>
Date: Thu, 14 Jan 2021 13:31:15 +0100
Subject: [PATCH] More MingW 8.1 warning workarounds

Change-Id: Ib1df65672c312abce4489f5175d9a69af157c206
---
 .../VulkanMemoryAllocator/vk_mem_alloc.h      | 37 +++++++++++++------
 1 file changed, 25 insertions(+), 12 deletions(-)

diff --git a/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h b/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
index ebaeb4bcff..6b10e1eb94 100644
--- a/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
+++ b/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
@@ -4086,6 +4086,8 @@ static void VmaWriteMagicValue(void* pData, VkDeviceSize offset)
     }
 #else
     // no-op
+    (void) pData;
+    (void) offset;
 #endif
 }
 
@@ -4101,6 +4103,9 @@ static bool VmaValidateMagicValue(const void* pData, VkDeviceSize offset)
             return false;
         }
     }
+#else
+    (void) pData;
+    (void) offset;
 #endif
     return true;
 }
@@ -4400,7 +4405,7 @@ public:
     
     // This version of the constructor is here for compatibility with pre-C++14 std::vector.
     // value is unused.
-    VmaVector(size_t count, const T& value, const AllocatorT& allocator)
+    VmaVector(size_t count, const T& /*value*/, const AllocatorT& allocator)
         : VmaVector(count, allocator) {}
     
     VmaVector(const VmaVector<T, AllocatorT>& src) :
@@ -6002,7 +6007,7 @@ private:
         VkDeviceSize allocAlignment,
         VmaSuballocationType allocType,
         bool canMakeOtherLost,
-        uint32_t strategy,
+        uint32_t /*strategy*/,
         VmaAllocationRequest* pAllocationRequest);
     bool CreateAllocationRequest_UpperAddress(
         uint32_t currentFrameIndex,
@@ -10098,14 +10103,14 @@ bool VmaBlockMetadata_Linear::CreateAllocationRequest(
 }
 
 bool VmaBlockMetadata_Linear::CreateAllocationRequest_UpperAddress(
-    uint32_t currentFrameIndex,
-    uint32_t frameInUseCount,
+    uint32_t /*currentFrameIndex*/,
+    uint32_t /*frameInUseCount*/,
     VkDeviceSize bufferImageGranularity,
     VkDeviceSize allocSize,
     VkDeviceSize allocAlignment,
     VmaSuballocationType allocType,
-    bool canMakeOtherLost,
-    uint32_t strategy,
+    bool /*canMakeOtherLost*/,
+    uint32_t /*strategy*/,
     VmaAllocationRequest* pAllocationRequest)
 {
     const VkDeviceSize size = GetSize();
@@ -10227,7 +10232,7 @@ bool VmaBlockMetadata_Linear::CreateAllocationRequest_LowerAddress(
     VkDeviceSize allocAlignment,
     VmaSuballocationType allocType,
     bool canMakeOtherLost,
-    uint32_t strategy,
+    uint32_t /*strategy*/,
     VmaAllocationRequest* pAllocationRequest)
 {
     const VkDeviceSize size = GetSize();
@@ -10678,6 +10683,7 @@ void VmaBlockMetadata_Linear::Alloc(
             // New allocation at the end of 2-part ring buffer, so before first allocation from 1st vector.
             VMA_ASSERT(!suballocations1st.empty() &&
                 request.offset + allocSize <= suballocations1st[m_1stNullItemsBeginCount].offset);
+            (void) suballocations1st;
             SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
 
             switch(m_2ndVectorMode)
@@ -11932,7 +11938,7 @@ VkResult VmaBlockVector::AllocatePage(
     const bool mapped = (createInfo.flags & VMA_ALLOCATION_CREATE_MAPPED_BIT) != 0;
     const bool isUserDataString = (createInfo.flags & VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT) != 0;
     
-    const bool withinBudget = (createInfo.flags & VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT) != 0;
+    //const bool withinBudget = (createInfo.flags & VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT) != 0;
     VkDeviceSize freeMemory;
     {
         const uint32_t heapIndex = m_hAllocator->MemoryTypeIndexToHeapIndex(m_MemoryTypeIndex);
@@ -15976,7 +15982,8 @@ VkResult VmaAllocator_T::BindVulkanBuffer(
         if((m_UseKhrBindMemory2 || m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0)) &&
             m_VulkanFunctions.vkBindBufferMemory2KHR != VMA_NULL)
         {
-            VkBindBufferMemoryInfoKHR bindBufferMemoryInfo = { VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHR };
+            VkBindBufferMemoryInfoKHR bindBufferMemoryInfo = {};
+            bindBufferMemoryInfo.sType = VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHR;
             bindBufferMemoryInfo.pNext = pNext;
             bindBufferMemoryInfo.buffer = buffer;
             bindBufferMemoryInfo.memory = memory;
@@ -16007,7 +16014,8 @@ VkResult VmaAllocator_T::BindVulkanImage(
         if((m_UseKhrBindMemory2 || m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0)) &&
             m_VulkanFunctions.vkBindImageMemory2KHR != VMA_NULL)
         {
-            VkBindImageMemoryInfoKHR bindBufferMemoryInfo = { VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR };
+            VkBindImageMemoryInfoKHR bindBufferMemoryInfo = {};
+            bindBufferMemoryInfo.sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR;
             bindBufferMemoryInfo.pNext = pNext;
             bindBufferMemoryInfo.image = image;
             bindBufferMemoryInfo.memory = memory;
@@ -16263,9 +16271,11 @@ void VmaAllocator_T::UpdateVulkanBudget()
 {
     VMA_ASSERT(m_UseExtMemoryBudget);
 
-    VkPhysicalDeviceMemoryProperties2KHR memProps = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR };
+    VkPhysicalDeviceMemoryProperties2KHR memProps = {};
+    memProps.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR;
 
-    VkPhysicalDeviceMemoryBudgetPropertiesEXT budgetProps = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT };
+    VkPhysicalDeviceMemoryBudgetPropertiesEXT budgetProps = {};
+    budgetProps.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT;
     memProps.pNext = &budgetProps;
 
     GetVulkanFunctions().vkGetPhysicalDeviceMemoryProperties2KHR(m_PhysicalDevice, &memProps);
@@ -16883,6 +16893,7 @@ VMA_CALL_PRE void VMA_CALL_POST vmaGetPoolName(
     const char** ppName)
 {
     VMA_ASSERT(allocator && pool);
+    (void) allocator;
     
     VMA_DEBUG_LOG("vmaGetPoolName");
 
@@ -16909,6 +16920,8 @@ VMA_CALL_PRE void VMA_CALL_POST vmaSetPoolName(
     {
         allocator->GetRecorder()->RecordSetPoolName(allocator->GetCurrentFrameIndex(), pool, pName);
     }
+#else
+    (void) allocator;
 #endif
 }
 
-- 
2.23.0.windows.1