VKAPI_ATTR and VKAPI_CALL macros in Vulkan

后端 未结 2 561
半阙折子戏
半阙折子戏 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:51

    They are defined in vk_platform.h.

    They are C preprocessor macros that expand to platform-dependent (and often compiler-specific) function attributes.

    The spec defines what they are supposed to do.
    But basically each of VKAPI_ATTR, VKAPI_CALL and VKAPI_PTR is distiguished by the spot it has to be in the function declaration to satisfy the C (potentially compiler-dependent) syntax.
    Their value(s) are things like the chosen calling convention (e.g. __stdcall) for the platform (detected at compile time).

提交回复
热议问题