VKAPI_ATTR and VKAPI_CALL macros in Vulkan

后端 未结 2 560
半阙折子戏
半阙折子戏 2021-01-20 08:52

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

2条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-20 09:49

    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.

提交回复
热议问题