Path: blob/21.2-virgl/include/vulkan/vk_platform.h
4545 views
//1// File: vk_platform.h2//3/*4** Copyright 2014-2021 The Khronos Group Inc.5**6** SPDX-License-Identifier: Apache-2.07*/8910#ifndef VK_PLATFORM_H_11#define VK_PLATFORM_H_1213#ifdef __cplusplus14extern "C"15{16#endif // __cplusplus1718/*19***************************************************************************************************20* Platform-specific directives and type declarations21***************************************************************************************************22*/2324/* Platform-specific calling convention macros.25*26* Platforms should define these so that Vulkan clients call Vulkan commands27* with the same calling conventions that the Vulkan implementation expects.28*29* VKAPI_ATTR - Placed before the return type in function declarations.30* Useful for C++11 and GCC/Clang-style function attribute syntax.31* VKAPI_CALL - Placed after the return type in function declarations.32* Useful for MSVC-style calling convention syntax.33* VKAPI_PTR - Placed between the '(' and '*' in function pointer types.34*35* Function declaration: VKAPI_ATTR void VKAPI_CALL vkCommand(void);36* Function pointer type: typedef void (VKAPI_PTR *PFN_vkCommand)(void);37*/38#if defined(_WIN32)39// On Windows, Vulkan commands use the stdcall convention40#define VKAPI_ATTR41#define VKAPI_CALL __stdcall42#define VKAPI_PTR VKAPI_CALL43#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH < 744#error "Vulkan isn't supported for the 'armeabi' NDK ABI"45#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7 && defined(__ARM_32BIT_STATE)46// On Android 32-bit ARM targets, Vulkan functions use the "hardfloat"47// calling convention, i.e. float parameters are passed in registers. This48// is true even if the rest of the application passes floats on the stack,49// as it does by default when compiling for the armeabi-v7a NDK ABI.50#define VKAPI_ATTR __attribute__((pcs("aapcs-vfp")))51#define VKAPI_CALL52#define VKAPI_PTR VKAPI_ATTR53#else54// On other platforms, use the default calling convention55#define VKAPI_ATTR56#define VKAPI_CALL57#define VKAPI_PTR58#endif5960#if !defined(VK_NO_STDDEF_H)61#include <stddef.h>62#endif // !defined(VK_NO_STDDEF_H)6364#if !defined(VK_NO_STDINT_H)65#if defined(_MSC_VER) && (_MSC_VER < 1600)66typedef signed __int8 int8_t;67typedef unsigned __int8 uint8_t;68typedef signed __int16 int16_t;69typedef unsigned __int16 uint16_t;70typedef signed __int32 int32_t;71typedef unsigned __int32 uint32_t;72typedef signed __int64 int64_t;73typedef unsigned __int64 uint64_t;74#else75#include <stdint.h>76#endif77#endif // !defined(VK_NO_STDINT_H)7879#ifdef __cplusplus80} // extern "C"81#endif // __cplusplus8283#endif848586