Additional platform-specific macros and interfaces are defined using the
included vk_platform.h
file.
These macros are used to control platform-dependent behavior, and their
exact definitions are under the control of specific platforms and Vulkan
implementations.
On many platforms the following macros are empty strings, causing platform- and compiler-specific default calling conventions to be used.
VKAPI_ATTR
is a macro placed before the return type in Vulkan API
function declarations.
This macro controls calling conventions for C++11 and GCC/Clang-style
compilers.
VKAPI_CALL
is a macro placed after the return type in Vulkan API
function declarations.
This macro controls calling conventions for MSVC-style compilers.
VKAPI_PTR
is a macro placed between the ( and * in Vulkan API
function pointer declarations.
This macro also controls calling conventions, and typically has the same
definition as VKAPI_ATTR
or VKAPI_CALL
, depending on the
compiler.
If the VK_NO_STDINT_H
macro is defined by the application at compile time,
extended integer types used by vulkan.h
, such as uint8_t
, must also
be defined by the application.
Otherwise, vulkan.h
will not compile.
If VK_NO_STDINT_H
is not defined, the system <stdint.h>
is used to
define these types, or there is a fallback path when Microsoft Visual Studio
version 2008 and earlier versions are detected at compile time.
To use a Vulkan extension supporting a platform-specific window system, header files for that window systems must be included at compile time. The Vulkan header files cannot determine whether or not an external header is available at compile time, so applications wishing to use such an extension must #define a macro causing such headers to be included. If this is not done, the corresponding extension interfaces will not be defined and they will be unusable.
The extensions, required compile time symbols to enable them, window systems they correspond to, and external header files that are included when the macro is #defined are shown in the following table.
Table D.1. Window System Extensions and Required Compile Time Symbol Definitions
Extension Name | Required Compile Time Symbol | Window System Name | External Header Files Used |
---|---|---|---|
|
| Android Native |
|
|
| Mir |
|
|
| Wayland |
|
|
| Microsoft Windows |
|
|
| X Window System Xcb library |
|
|
| X Window System Xlib library |
|