Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VKAPI_ATTR and VKAPI_CALL macros in Vulkan

Tags:

c++

vulkan

I have been searching and I still am not sure what VKAPI_ATTR and VKAPI_CALL are. I am not sure if they are suppose to be a macro or some fancy C++ function declaration I am not aware of.

What is VKAPI_ATTR void VKAPI_CALL vkCommand(void) offering that void vkCommand(void) doesn't offer?

like image 373
FrickeFresh Avatar asked Dec 03 '25 14:12

FrickeFresh


1 Answers

They are macros to make sure the correct calling convention is applied. This is less important in 64 bit where they have mostly converged but in 32 bit there are several incompatible ones.

Unfortunately different compilers have different ways of doing that. One puts the required token before the return value the other puts it after.

So the header uses both to make sure it can cover all bases.

like image 108
ratchet freak Avatar answered Dec 06 '25 06:12

ratchet freak