From dd2061b073175f0c97cf001994888833aac9827a Mon Sep 17 00:00:00 2001 From: Biswapriyo Nath Date: Wed, 10 Apr 2024 14:03:38 +0000 Subject: [PATCH] render/vulkan: Fix clang compiler error in 32 bit ARM Android This adds proper calling convention attribute for callbacks used in vulkan and fixes the following compiler error. ../src/render/vulkan/vulkan.c:175:22: error: incompatible function pointer types initializing 'PFN_vkDebugUtilsMessengerCallbackEXT' (aka 'unsigned int (*) (enum VkDebugUtilsMessageSeverityFlagBitsEXT, unsigned int, const struct VkDebugUtilsMessengerCallbackDataEXT *, void *) __attribute__((pcs("aapcs-vfp")))') with an expression of type 'VkBool32 (*)(VkDebugUtilsMessageSeverityFlagBitsEXT, VkDebugUtilsMessageTypeFlagsEXT, const VkDebugUtilsMessengerCallbackDataEXT *, void *)' (aka 'unsigned int (*)(enum VkDebugUtilsMessageSeverityFlagBitsEXT, unsigned int, const struct VkDebugUtilsMessengerCallbackDataEXT *, void *)') [-Wincompatible-function-pointer-types] .pfnUserCallback = &debug_callback, ^~~~~~~~~~~~~~~ --- render/vulkan/vulkan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/render/vulkan/vulkan.c b/render/vulkan/vulkan.c index 54bfa77a4..c2eff4009 100644 --- a/render/vulkan/vulkan.c +++ b/render/vulkan/vulkan.c @@ -31,7 +31,7 @@ static bool check_extension(const VkExtensionProperties *avail, return false; } -static VkBool32 debug_callback(VkDebugUtilsMessageSeverityFlagBitsEXT severity, +static VKAPI_ATTR VkBool32 debug_callback(VkDebugUtilsMessageSeverityFlagBitsEXT severity, VkDebugUtilsMessageTypeFlagsEXT type, const VkDebugUtilsMessengerCallbackDataEXT *debug_data, void *data) {