Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build error in arm32 #95975

Merged
merged 1 commit into from
Aug 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions drivers/vulkan/rendering_context_driver_vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,13 @@ VkAllocationCallbacks *RenderingContextDriverVulkan::get_allocation_callbacks(Vk
#if !defined(VK_TRACK_DRIVER_MEMORY)
return nullptr;
#else

#ifdef _MSC_VER
#define LAMBDA_VK_CALL_CONV
#else
#define LAMBDA_VK_CALL_CONV VKAPI_PTR
#endif

struct TrackedMemHeader {
size_t size;
VkSystemAllocationScope allocation_scope;
Expand All @@ -241,7 +248,7 @@ VkAllocationCallbacks *RenderingContextDriverVulkan::get_allocation_callbacks(Vk
void *p_user_data,
size_t size,
size_t alignment,
VkSystemAllocationScope allocation_scope) -> void * {
VkSystemAllocationScope allocation_scope) LAMBDA_VK_CALL_CONV -> void * {
static constexpr size_t tracking_data_size = 32;
VkTrackedObjectType type = static_cast<VkTrackedObjectType>(*reinterpret_cast<VkTrackedObjectType *>(p_user_data));

Expand Down Expand Up @@ -274,7 +281,7 @@ VkAllocationCallbacks *RenderingContextDriverVulkan::get_allocation_callbacks(Vk
void *p_original,
size_t size,
size_t alignment,
VkSystemAllocationScope allocation_scope) -> void * {
VkSystemAllocationScope allocation_scope) LAMBDA_VK_CALL_CONV -> void * {
if (p_original == nullptr) {
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);
Expand Down Expand Up @@ -305,7 +312,7 @@ VkAllocationCallbacks *RenderingContextDriverVulkan::get_allocation_callbacks(Vk
// Free function
[](
void *p_user_data,
void *p_memory) {
void *p_memory) LAMBDA_VK_CALL_CONV {
if (!p_memory) {
return;
}
Expand All @@ -326,13 +333,13 @@ VkAllocationCallbacks *RenderingContextDriverVulkan::get_allocation_callbacks(Vk
void *p_user_data,
size_t size,
VkInternalAllocationType allocation_type,
VkSystemAllocationScope allocation_scope) {
VkSystemAllocationScope allocation_scope) LAMBDA_VK_CALL_CONV {
},
[](
void *p_user_data,
size_t size,
VkInternalAllocationType allocation_type,
VkSystemAllocationScope allocation_scope) {
VkSystemAllocationScope allocation_scope) LAMBDA_VK_CALL_CONV {
},
};

Expand Down
Loading