vk/0.210.0: Switch to the new VKAPI function decorations
While we're at it, we do a bunch of the VkResult -> void updates
This commit is contained in:
@@ -144,60 +144,60 @@ typedef struct {
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Function types
|
||||
|
||||
typedef VkResult (VKAPI *PFN_vkGetSurfacePropertiesKHR)(VkDevice device, const VkSurfaceDescriptionKHR* pSurfaceDescription, VkSurfacePropertiesKHR* pSurfaceProperties);
|
||||
typedef VkResult (VKAPI *PFN_vkGetSurfaceFormatsKHR)(VkDevice device, const VkSurfaceDescriptionKHR* pSurfaceDescription, uint32_t* pCount, VkSurfaceFormatKHR* pSurfaceFormats);
|
||||
typedef VkResult (VKAPI *PFN_vkGetSurfacePresentModesKHR)(VkDevice device, const VkSurfaceDescriptionKHR* pSurfaceDescription, uint32_t* pCount, VkPresentModeKHR* pPresentModes);
|
||||
typedef VkResult (VKAPI *PFN_vkCreateSwapchainKHR)(VkDevice device, const VkSwapchainCreateInfoKHR* pCreateInfo, VkSwapchainKHR* pSwapchain);
|
||||
typedef VkResult (VKAPI *PFN_vkDestroySwapchainKHR)(VkDevice device, VkSwapchainKHR swapchain);
|
||||
typedef VkResult (VKAPI *PFN_vkGetSwapchainImagesKHR)(VkDevice device, VkSwapchainKHR swapchain, uint32_t* pCount, VkImage* pSwapchainImages);
|
||||
typedef VkResult (VKAPI *PFN_vkAcquireNextImageKHR)(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, uint32_t* pImageIndex);
|
||||
typedef VkResult (VKAPI *PFN_vkQueuePresentKHR)(VkQueue queue, VkPresentInfoKHR* pPresentInfo);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetSurfacePropertiesKHR)(VkDevice device, const VkSurfaceDescriptionKHR* pSurfaceDescription, VkSurfacePropertiesKHR* pSurfaceProperties);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetSurfaceFormatsKHR)(VkDevice device, const VkSurfaceDescriptionKHR* pSurfaceDescription, uint32_t* pCount, VkSurfaceFormatKHR* pSurfaceFormats);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetSurfacePresentModesKHR)(VkDevice device, const VkSurfaceDescriptionKHR* pSurfaceDescription, uint32_t* pCount, VkPresentModeKHR* pPresentModes);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateSwapchainKHR)(VkDevice device, const VkSwapchainCreateInfoKHR* pCreateInfo, VkSwapchainKHR* pSwapchain);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkDestroySwapchainKHR)(VkDevice device, VkSwapchainKHR swapchain);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetSwapchainImagesKHR)(VkDevice device, VkSwapchainKHR swapchain, uint32_t* pCount, VkImage* pSwapchainImages);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkAcquireNextImageKHR)(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, uint32_t* pImageIndex);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkQueuePresentKHR)(VkQueue queue, VkPresentInfoKHR* pPresentInfo);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Function prototypes
|
||||
|
||||
#ifdef VK_PROTOTYPES
|
||||
|
||||
VkResult VKAPI vkGetSurfacePropertiesKHR(
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkGetSurfacePropertiesKHR(
|
||||
VkDevice device,
|
||||
const VkSurfaceDescriptionKHR* pSurfaceDescription,
|
||||
VkSurfacePropertiesKHR* pSurfaceProperties);
|
||||
|
||||
VkResult VKAPI vkGetSurfaceFormatsKHR(
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkGetSurfaceFormatsKHR(
|
||||
VkDevice device,
|
||||
const VkSurfaceDescriptionKHR* pSurfaceDescription,
|
||||
uint32_t* pCount,
|
||||
VkSurfaceFormatKHR* pSurfaceFormats);
|
||||
|
||||
VkResult VKAPI vkGetSurfacePresentModesKHR(
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkGetSurfacePresentModesKHR(
|
||||
VkDevice device,
|
||||
const VkSurfaceDescriptionKHR* pSurfaceDescription,
|
||||
uint32_t* pCount,
|
||||
VkPresentModeKHR* pPresentModes);
|
||||
|
||||
VkResult VKAPI vkCreateSwapchainKHR(
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkCreateSwapchainKHR(
|
||||
VkDevice device,
|
||||
const VkSwapchainCreateInfoKHR* pCreateInfo,
|
||||
VkSwapchainKHR* pSwapchain);
|
||||
|
||||
VkResult VKAPI vkDestroySwapchainKHR(
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkDestroySwapchainKHR(
|
||||
VkDevice device,
|
||||
VkSwapchainKHR swapchain);
|
||||
|
||||
VkResult VKAPI vkGetSwapchainImagesKHR(
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkGetSwapchainImagesKHR(
|
||||
VkDevice device,
|
||||
VkSwapchainKHR swapchain,
|
||||
uint32_t* pCount,
|
||||
VkImage* pSwapchainImages);
|
||||
|
||||
VkResult VKAPI vkAcquireNextImageKHR(
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkAcquireNextImageKHR(
|
||||
VkDevice device,
|
||||
VkSwapchainKHR swapchain,
|
||||
uint64_t timeout,
|
||||
VkSemaphore semaphore,
|
||||
uint32_t* pImageIndex);
|
||||
|
||||
VkResult VKAPI vkQueuePresentKHR(
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkQueuePresentKHR(
|
||||
VkQueue queue,
|
||||
VkPresentInfoKHR* pPresentInfo);
|
||||
|
||||
|
@@ -131,14 +131,14 @@ typedef struct {
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Function types
|
||||
|
||||
typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceSurfaceSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, const VkSurfaceDescriptionKHR* pSurfaceDescription, VkBool32* pSupported);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, const VkSurfaceDescriptionKHR* pSurfaceDescription, VkBool32* pSupported);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Function prototypes
|
||||
|
||||
#ifdef VK_PROTOTYPES
|
||||
|
||||
VkResult VKAPI vkGetPhysicalDeviceSurfaceSupportKHR(
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceSupportKHR(
|
||||
VkPhysicalDevice physicalDevice,
|
||||
uint32_t queueFamilyIndex,
|
||||
const VkSurfaceDescriptionKHR* pSurfaceDescription,
|
||||
|
@@ -39,15 +39,40 @@ extern "C"
|
||||
***************************************************************************************************
|
||||
*/
|
||||
|
||||
/* Platform-specific calling convention macros.
|
||||
*
|
||||
* Platforms should define these so that Vulkan clients call Vulkan commands
|
||||
* with the same calling conventions that the Vulkan implementation expects.
|
||||
*
|
||||
* VKAPI_ATTR - Placed before the return type in function declarations.
|
||||
* Useful for C++11 and GCC/Clang-style function attribute syntax.
|
||||
* VKAPI_CALL - Placed after the return type in function declarations.
|
||||
* Useful for MSVC-style calling convention syntax.
|
||||
* VKAPI_PTR - Placed between the '(' and '*' in function pointer types.
|
||||
*
|
||||
* Function declaration: VKAPI_ATTR void VKAPI_CALL vkCommand(void);
|
||||
* Function pointer type: typedef void (VKAPI_PTR *PFN_vkCommand)(void);
|
||||
*/
|
||||
#if defined(_WIN32)
|
||||
// On Windows, VKAPI should equate to the __stdcall convention
|
||||
#define VKAPI __stdcall
|
||||
#elif defined(__GNUC__)
|
||||
// On other platforms using GCC, VKAPI stays undefined
|
||||
#define VKAPI
|
||||
// On Windows, Vulkan commands use the stdcall convention
|
||||
#define VKAPI_ATTR
|
||||
#define VKAPI_CALL __stdcall
|
||||
#define VKAPI_PTR VKAPI_CALL
|
||||
#elif defined(__ANDROID__) && defined(__ARM_EABI__) && !defined(__ARM_ARCH_7A__)
|
||||
// Android does not support Vulkan in native code using the "armeabi" ABI.
|
||||
#error "Vulkan requires the 'armeabi-v7a' or 'armeabi-v7a-hard' ABI on 32-bit ARM CPUs"
|
||||
#elif defined(__ANDROID__) && defined(__ARM_ARCH_7A__)
|
||||
// On Android/ARMv7a, Vulkan functions use the armeabi-v7a-hard calling
|
||||
// convention, even if the application's native code is compiled with the
|
||||
// armeabi-v7a calling convention.
|
||||
#define VKAPI_ATTR __attribute__((pcs("aapcs-vfp")))
|
||||
#define VKAPI_CALL
|
||||
#define VKAPI_PTR VKAPI_ATTR
|
||||
#else
|
||||
// Unsupported Platform!
|
||||
#error "Unsupported OS Platform detected!"
|
||||
// On other platforms, use the default calling convention
|
||||
#define VKAPI_ATTR
|
||||
#define VKAPI_CALL
|
||||
#define VKAPI_PTR
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -42,11 +42,11 @@ typedef struct VkDmaBufImageCreateInfo_
|
||||
uint32_t strideInBytes;
|
||||
} VkDmaBufImageCreateInfo;
|
||||
|
||||
typedef VkResult (VKAPI *PFN_vkCreateDmaBufImageINTEL)(VkDevice device, const VkDmaBufImageCreateInfo* pCreateInfo, VkDeviceMemory* pMem, VkImage* pImage);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateDmaBufImageINTEL)(VkDevice device, const VkDmaBufImageCreateInfo* pCreateInfo, VkDeviceMemory* pMem, VkImage* pImage);
|
||||
|
||||
#ifdef VK_PROTOTYPES
|
||||
|
||||
VkResult VKAPI vkCreateDmaBufImageINTEL(
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkCreateDmaBufImageINTEL(
|
||||
VkDevice _device,
|
||||
const VkDmaBufImageCreateInfo* pCreateInfo,
|
||||
VkDeviceMemory* pMem,
|
||||
|
Reference in New Issue
Block a user