Merge pull request #95975 from darksylinc/matias-TheForge-hotfix

Fix build error in arm32
This commit is contained in:
Rémi Verschelde 2024-08-24 01:01:37 +02:00 committed by GitHub
commit e3550cb20f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -229,6 +229,13 @@ VkAllocationCallbacks *RenderingContextDriverVulkan::get_allocation_callbacks(Vk
#if !defined(VK_TRACK_DRIVER_MEMORY) #if !defined(VK_TRACK_DRIVER_MEMORY)
return nullptr; return nullptr;
#else #else
#ifdef _MSC_VER
#define LAMBDA_VK_CALL_CONV
#else
#define LAMBDA_VK_CALL_CONV VKAPI_PTR
#endif
struct TrackedMemHeader { struct TrackedMemHeader {
size_t size; size_t size;
VkSystemAllocationScope allocation_scope; VkSystemAllocationScope allocation_scope;
@ -241,7 +248,7 @@ VkAllocationCallbacks *RenderingContextDriverVulkan::get_allocation_callbacks(Vk
void *p_user_data, void *p_user_data,
size_t size, size_t size,
size_t alignment, size_t alignment,
VkSystemAllocationScope allocation_scope) -> void * { VkSystemAllocationScope allocation_scope) LAMBDA_VK_CALL_CONV -> void * {
static constexpr size_t tracking_data_size = 32; static constexpr size_t tracking_data_size = 32;
VkTrackedObjectType type = static_cast<VkTrackedObjectType>(*reinterpret_cast<VkTrackedObjectType *>(p_user_data)); VkTrackedObjectType type = static_cast<VkTrackedObjectType>(*reinterpret_cast<VkTrackedObjectType *>(p_user_data));
@ -274,7 +281,7 @@ VkAllocationCallbacks *RenderingContextDriverVulkan::get_allocation_callbacks(Vk
void *p_original, void *p_original,
size_t size, size_t size,
size_t alignment, size_t alignment,
VkSystemAllocationScope allocation_scope) -> void * { VkSystemAllocationScope allocation_scope) LAMBDA_VK_CALL_CONV -> void * {
if (p_original == nullptr) { if (p_original == nullptr) {
VkObjectType type = static_cast<VkObjectType>(*reinterpret_cast<uint32_t *>(p_user_data)); VkObjectType type = static_cast<VkObjectType>(*reinterpret_cast<uint32_t *>(p_user_data));
return get_allocation_callbacks(type)->pfnAllocation(p_user_data, size, alignment, allocation_scope); return get_allocation_callbacks(type)->pfnAllocation(p_user_data, size, alignment, allocation_scope);
@ -305,7 +312,7 @@ VkAllocationCallbacks *RenderingContextDriverVulkan::get_allocation_callbacks(Vk
// Free function // Free function
[]( [](
void *p_user_data, void *p_user_data,
void *p_memory) { void *p_memory) LAMBDA_VK_CALL_CONV {
if (!p_memory) { if (!p_memory) {
return; return;
} }
@ -326,13 +333,13 @@ VkAllocationCallbacks *RenderingContextDriverVulkan::get_allocation_callbacks(Vk
void *p_user_data, void *p_user_data,
size_t size, size_t size,
VkInternalAllocationType allocation_type, VkInternalAllocationType allocation_type,
VkSystemAllocationScope allocation_scope) { VkSystemAllocationScope allocation_scope) LAMBDA_VK_CALL_CONV {
}, },
[]( [](
void *p_user_data, void *p_user_data,
size_t size, size_t size,
VkInternalAllocationType allocation_type, VkInternalAllocationType allocation_type,
VkSystemAllocationScope allocation_scope) { VkSystemAllocationScope allocation_scope) LAMBDA_VK_CALL_CONV {
}, },
}; };