API Boilerplate
This appendix defines Vulkan API features that are infrastructure required for a complete functional description of Vulkan, but do not logically belong elsewhere in the Specification.
Vulkan Header Files
Vulkan is defined as an API in the C99 language.
Khronos provides a corresponding set of header files for applications using
the API, which may be used in either C or C++ code.
The interface descriptions in the specification are the same as the
interfaces defined in these header files, and both are derived from the
vk.xml
XML API Registry, which is the canonical machine-readable
description of the Vulkan API.
The Registry, scripts used for processing it into various forms, and
documentation of the registry schema are available as described at
https://registry.khronos.org/vulkan/#apiregistry .
Language bindings for other languages can be defined using the information in the Specification and the Registry. Khronos does not provide any such bindings, but third-party developers have created some additional bindings.
Vulkan Combined API Header vulkan.h
(Informative)
Applications normally will include the header vulkan.h
.
In turn, vulkan.h
always includes the following headers:
vk_platform.h
, defining platform-specific macros and headers.vulkan_core.h
, defining APIs for the Vulkan core and all registered extensions other than window system-specific and provisional extensions, which are included in separate header files.
In addition, specific preprocessor macros defined at the time
vulkan.h
is included cause header files for the corresponding window
system-specific and provisional interfaces to be included, as described
below.
Vulkan Platform-Specific Header vk_platform.h
(Informative)
Platform-specific macros and interfaces are defined in vk_platform.h
.
These macros are used to control platform-dependent behavior, and their
exact definitions are under the control of specific platforms and Vulkan
implementations.
Platform-Specific Calling Conventions
On many platforms the following macros are empty strings, causing platform- and compiler-specific default calling conventions to be used.
With these macros, a Vulkan function declaration takes the form of:
VKAPI_ATTR <return_type> VKAPI_CALL <command_name>(<command_parameters>);
Additionally, a Vulkan function pointer type declaration takes the form of:
typedef <return_type> (VKAPI_PTR *PFN_<command_name>)(<command_parameters>);
Platform-Specific Header Control
Vulkan Core API Header vulkan_core.h
Applications that do not make use of window system-specific extensions may
simply include vulkan_core.h
instead of vulkan.h
, although there is
usually no reason to do so.
In addition to the Vulkan API, vulkan_core.h
also defines a small number
of C preprocessor macros that are described below.
Vulkan Header File Version Number
Vulkan Handle Macros
Window System-Specific Header Control (Informative)
Provisional Extension Header Control (Informative)
Video Std Headers
Performing video coding operations usually involves the application having to provide various parameters, data structures, or other syntax elements specific to the particular video compression standard used, and the associated semantics are covered by the specification of those.
The interface descriptions of these are available in the header files
derived from the video.xml
XML file, which is the canonical
machine-readable description of data structures and enumerations that are
associated with the externally-provided video compression standards.
Video Std Header Name | Description | Header File | Related Extensions |
---|---|---|---|
Codec-independent common definitions | - | ||
ITU-T H.264 common definitions | VK_KHR_video_decode_h264, VK_KHR_video_encode_h264 | ||
ITU-T H.264 decode-specific definitions | VK_KHR_video_decode_h264 | ||
ITU-T H.264 encode-specific definitions | VK_KHR_video_encode_h264 | ||
ITU-T H.265 common definitions | VK_KHR_video_decode_h265, VK_KHR_video_encode_h265 | ||
ITU-T H.265 decode-specific definitions | VK_KHR_video_decode_h265 | ||
ITU-T H.265 encode-specific definitions | VK_KHR_video_encode_h265 | ||
AV1 common definitions | VK_KHR_video_decode_av1 | ||
AV1 decode-specific definitions | VK_KHR_video_decode_av1 |