Skip to content

Commit e3550cb

Browse files
authored
Merge pull request godotengine#95975 from darksylinc/matias-TheForge-hotfix
Fix build error in arm32
2 parents a1acd38 + 38ae58b commit e3550cb

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

drivers/vulkan/rendering_context_driver_vulkan.cpp

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,13 @@ VkAllocationCallbacks *RenderingContextDriverVulkan::get_allocation_callbacks(Vk
229229
#if !defined(VK_TRACK_DRIVER_MEMORY)
230230
return nullptr;
231231
#else
232+
233+
#ifdef _MSC_VER
234+
#define LAMBDA_VK_CALL_CONV
235+
#else
236+
#define LAMBDA_VK_CALL_CONV VKAPI_PTR
237+
#endif
238+
232239
struct TrackedMemHeader {
233240
size_t size;
234241
VkSystemAllocationScope allocation_scope;
@@ -241,7 +248,7 @@ VkAllocationCallbacks *RenderingContextDriverVulkan::get_allocation_callbacks(Vk
241248
void *p_user_data,
242249
size_t size,
243250
size_t alignment,
244-
VkSystemAllocationScope allocation_scope) -> void * {
251+
VkSystemAllocationScope allocation_scope) LAMBDA_VK_CALL_CONV -> void * {
245252
static constexpr size_t tracking_data_size = 32;
246253
VkTrackedObjectType type = static_cast<VkTrackedObjectType>(*reinterpret_cast<VkTrackedObjectType *>(p_user_data));
247254

@@ -274,7 +281,7 @@ VkAllocationCallbacks *RenderingContextDriverVulkan::get_allocation_callbacks(Vk
274281
void *p_original,
275282
size_t size,
276283
size_t alignment,
277-
VkSystemAllocationScope allocation_scope) -> void * {
284+
VkSystemAllocationScope allocation_scope) LAMBDA_VK_CALL_CONV -> void * {
278285
if (p_original == nullptr) {
279286
VkObjectType type = static_cast<VkObjectType>(*reinterpret_cast<uint32_t *>(p_user_data));
280287
return get_allocation_callbacks(type)->pfnAllocation(p_user_data, size, alignment, allocation_scope);
@@ -305,7 +312,7 @@ VkAllocationCallbacks *RenderingContextDriverVulkan::get_allocation_callbacks(Vk
305312
// Free function
306313
[](
307314
void *p_user_data,
308-
void *p_memory) {
315+
void *p_memory) LAMBDA_VK_CALL_CONV {
309316
if (!p_memory) {
310317
return;
311318
}
@@ -326,13 +333,13 @@ VkAllocationCallbacks *RenderingContextDriverVulkan::get_allocation_callbacks(Vk
326333
void *p_user_data,
327334
size_t size,
328335
VkInternalAllocationType allocation_type,
329-
VkSystemAllocationScope allocation_scope) {
336+
VkSystemAllocationScope allocation_scope) LAMBDA_VK_CALL_CONV {
330337
},
331338
[](
332339
void *p_user_data,
333340
size_t size,
334341
VkInternalAllocationType allocation_type,
335-
VkSystemAllocationScope allocation_scope) {
342+
VkSystemAllocationScope allocation_scope) LAMBDA_VK_CALL_CONV {
336343
},
337344
};
338345

0 commit comments

Comments
 (0)