Skip to content

Commit

Permalink
Fix build error in arm32
Browse files Browse the repository at this point in the history
Fixes #95973
  • Loading branch information
darksylinc committed Aug 23, 2024
1 parent 568589c commit 7fc742d
Showing 1 changed file with 12 additions and 5 deletions.
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 LAMBDA_VK_CALL_CONV

Check failure on line 236 in drivers/vulkan/rendering_context_driver_vulkan.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor w/ Mono (target=editor)

expected '{' before 'LAMBDA_VK_CALL_CONV'

Check failure on line 236 in drivers/vulkan/rendering_context_driver_vulkan.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor w/ Mono (target=editor)

expected '}' before 'LAMBDA_VK_CALL_CONV'

Check failure on line 236 in drivers/vulkan/rendering_context_driver_vulkan.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor w/ Mono (target=editor)

invalid user-defined conversion from 'RenderingContextDriverVulkan::get_allocation_callbacks(VkObjectType)::<lambda(void*, size_t, size_t, VkSystemAllocationScope)>' to 'PFN_vkAllocationFunction' {aka 'void* (*)(void*, long unsigned int, long unsigned int, VkSystemAllocationScope)'} [-fpermissive]

Check failure on line 236 in drivers/vulkan/rendering_context_driver_vulkan.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor w/ Mono (target=editor)

missing initializer for member 'VkAllocationCallbacks::pfnReallocation' [-Werror=missing-field-initializers]

Check failure on line 236 in drivers/vulkan/rendering_context_driver_vulkan.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor w/ Mono (target=editor)

missing initializer for member 'VkAllocationCallbacks::pfnFree' [-Werror=missing-field-initializers]

Check failure on line 236 in drivers/vulkan/rendering_context_driver_vulkan.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor w/ Mono (target=editor)

missing initializer for member 'VkAllocationCallbacks::pfnInternalAllocation' [-Werror=missing-field-initializers]

Check failure on line 236 in drivers/vulkan/rendering_context_driver_vulkan.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor w/ Mono (target=editor)

missing initializer for member 'VkAllocationCallbacks::pfnInternalFree' [-Werror=missing-field-initializers]

Check failure on line 236 in drivers/vulkan/rendering_context_driver_vulkan.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor w/ Mono (target=editor)

expected ',' or ';' before 'LAMBDA_VK_CALL_CONV'

Check failure on line 236 in drivers/vulkan/rendering_context_driver_vulkan.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor w/ Mono (target=editor)

expected '{' before 'LAMBDA_VK_CALL_CONV'

Check failure on line 236 in drivers/vulkan/rendering_context_driver_vulkan.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)

expected '{' before 'LAMBDA_VK_CALL_CONV'

Check failure on line 236 in drivers/vulkan/rendering_context_driver_vulkan.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)

expected '}' before 'LAMBDA_VK_CALL_CONV'

Check failure on line 236 in drivers/vulkan/rendering_context_driver_vulkan.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)

invalid user-defined conversion from 'RenderingContextDriverVulkan::get_allocation_callbacks(VkObjectType)::<lambda(void*, size_t, size_t, VkSystemAllocationScope)>' to 'PFN_vkAllocationFunction' {aka 'void* (*)(void*, long unsigned int, long unsigned int, VkSystemAllocationScope)'} [-fpermissive]

Check failure on line 236 in drivers/vulkan/rendering_context_driver_vulkan.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)

missing initializer for member 'VkAllocationCallbacks::pfnReallocation' [-Werror=missing-field-initializers]

Check failure on line 236 in drivers/vulkan/rendering_context_driver_vulkan.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)

missing initializer for member 'VkAllocationCallbacks::pfnFree' [-Werror=missing-field-initializers]

Check failure on line 236 in drivers/vulkan/rendering_context_driver_vulkan.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)

missing initializer for member 'VkAllocationCallbacks::pfnInternalAllocation' [-Werror=missing-field-initializers]

Check failure on line 236 in drivers/vulkan/rendering_context_driver_vulkan.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)

missing initializer for member 'VkAllocationCallbacks::pfnInternalFree' [-Werror=missing-field-initializers]

Check failure on line 236 in drivers/vulkan/rendering_context_driver_vulkan.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)

expected ',' or ';' before 'LAMBDA_VK_CALL_CONV'

Check failure on line 236 in drivers/vulkan/rendering_context_driver_vulkan.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)

expected '{' before 'LAMBDA_VK_CALL_CONV'
#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 * {

Check failure on line 251 in drivers/vulkan/rendering_context_driver_vulkan.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, tests=yes, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

expected body of lambda expression

Check failure on line 251 in drivers/vulkan/rendering_context_driver_vulkan.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, tests=yes, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

expected body of lambda expression
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

0 comments on commit 7fc742d

Please sign in to comment.