(Vulkan) Update headers - use C comments

This commit is contained in:
twinaphex 2018-05-13 21:42:02 +02:00
parent 7a88fafdb0
commit 96e1b862f6
6 changed files with 81 additions and 81 deletions

View File

@ -1,6 +1,5 @@
// /* File: vk_icd.h */
// File: vk_icd.h
//
/* /*
* Copyright (c) 2015-2016 The Khronos Group Inc. * Copyright (c) 2015-2016 The Khronos Group Inc.
* Copyright (c) 2015-2016 Valve Corporation * Copyright (c) 2015-2016 Valve Corporation
@ -26,28 +25,29 @@
#include "vulkan.h" #include "vulkan.h"
#include <stdbool.h> #include <stdbool.h>
// Loader-ICD version negotiation API. Versions add the following features: /* Loader-ICD version negotiation API. Versions add the following features:
// Version 0 - Initial. Doesn't support vk_icdGetInstanceProcAddr * Version 0 - Initial. Doesn't support vk_icdGetInstanceProcAddr
// or vk_icdNegotiateLoaderICDInterfaceVersion. * or vk_icdNegotiateLoaderICDInterfaceVersion.
// Version 1 - Add support for vk_icdGetInstanceProcAddr. * Version 1 - Add support for vk_icdGetInstanceProcAddr.
// Version 2 - Add Loader/ICD Interface version negotiation * Version 2 - Add Loader/ICD Interface version negotiation
// via vk_icdNegotiateLoaderICDInterfaceVersion. * via vk_icdNegotiateLoaderICDInterfaceVersion.
// Version 3 - Add ICD creation/destruction of KHR_surface objects. * Version 3 - Add ICD creation/destruction of KHR_surface objects.
// Version 4 - Add unknown physical device extension qyering via * Version 4 - Add unknown physical device extension qyering via
// vk_icdGetPhysicalDeviceProcAddr. * vk_icdGetPhysicalDeviceProcAddr.
// Version 5 - Tells ICDs that the loader is now paying attention to the * Version 5 - Tells ICDs that the loader is now paying attention to the
// application version of Vulkan passed into the ApplicationInfo * application version of Vulkan passed into the ApplicationInfo
// structure during vkCreateInstance. This will tell the ICD * structure during vkCreateInstance. This will tell the ICD
// that if the loader is older, it should automatically fail a * that if the loader is older, it should automatically fail a
// call for any API version > 1.0. Otherwise, the loader will * call for any API version > 1.0. Otherwise, the loader will
// manually determine if it can support the expected version. * manually determine if it can support the expected version.
*/
#define CURRENT_LOADER_ICD_INTERFACE_VERSION 5 #define CURRENT_LOADER_ICD_INTERFACE_VERSION 5
#define MIN_SUPPORTED_LOADER_ICD_INTERFACE_VERSION 0 #define MIN_SUPPORTED_LOADER_ICD_INTERFACE_VERSION 0
#define MIN_PHYS_DEV_EXTENSION_ICD_INTERFACE_VERSION 4 #define MIN_PHYS_DEV_EXTENSION_ICD_INTERFACE_VERSION 4
typedef VkResult(VKAPI_PTR *PFN_vkNegotiateLoaderICDInterfaceVersion)(uint32_t *pVersion); typedef VkResult(VKAPI_PTR *PFN_vkNegotiateLoaderICDInterfaceVersion)(uint32_t *pVersion);
// This is defined in vk_layer.h which will be found by the loader, but if an ICD is building against this /* This is defined in vk_layer.h which will be found by the loader, but if an ICD is building against this
// file directly, it won't be found. * file directly, it won't be found. */
#ifndef PFN_GetPhysicalDeviceProcAddr #ifndef PFN_GetPhysicalDeviceProcAddr
typedef PFN_vkVoidFunction(VKAPI_PTR *PFN_GetPhysicalDeviceProcAddr)(VkInstance instance, const char *pName); typedef PFN_vkVoidFunction(VKAPI_PTR *PFN_GetPhysicalDeviceProcAddr)(VkInstance instance, const char *pName);
#endif #endif
@ -101,7 +101,7 @@ typedef struct {
MirConnection *connection; MirConnection *connection;
MirSurface *mirSurface; MirSurface *mirSurface;
} VkIcdSurfaceMir; } VkIcdSurfaceMir;
#endif // VK_USE_PLATFORM_MIR_KHR #endif /* VK_USE_PLATFORM_MIR_KHR */
#ifdef VK_USE_PLATFORM_WAYLAND_KHR #ifdef VK_USE_PLATFORM_WAYLAND_KHR
typedef struct { typedef struct {
@ -109,7 +109,7 @@ typedef struct {
struct wl_display *display; struct wl_display *display;
struct wl_surface *surface; struct wl_surface *surface;
} VkIcdSurfaceWayland; } VkIcdSurfaceWayland;
#endif // VK_USE_PLATFORM_WAYLAND_KHR #endif /* VK_USE_PLATFORM_WAYLAND_KHR */
#ifdef VK_USE_PLATFORM_WIN32_KHR #ifdef VK_USE_PLATFORM_WIN32_KHR
typedef struct { typedef struct {
@ -117,7 +117,7 @@ typedef struct {
HINSTANCE hinstance; HINSTANCE hinstance;
HWND hwnd; HWND hwnd;
} VkIcdSurfaceWin32; } VkIcdSurfaceWin32;
#endif // VK_USE_PLATFORM_WIN32_KHR #endif /* VK_USE_PLATFORM_WIN32_KHR */
#ifdef VK_USE_PLATFORM_XCB_KHR #ifdef VK_USE_PLATFORM_XCB_KHR
typedef struct { typedef struct {
@ -125,7 +125,7 @@ typedef struct {
xcb_connection_t *connection; xcb_connection_t *connection;
xcb_window_t window; xcb_window_t window;
} VkIcdSurfaceXcb; } VkIcdSurfaceXcb;
#endif // VK_USE_PLATFORM_XCB_KHR #endif /* VK_USE_PLATFORM_XCB_KHR */
#ifdef VK_USE_PLATFORM_XLIB_KHR #ifdef VK_USE_PLATFORM_XLIB_KHR
typedef struct { typedef struct {
@ -133,28 +133,28 @@ typedef struct {
Display *dpy; Display *dpy;
Window window; Window window;
} VkIcdSurfaceXlib; } VkIcdSurfaceXlib;
#endif // VK_USE_PLATFORM_XLIB_KHR #endif /* VK_USE_PLATFORM_XLIB_KHR */
#ifdef VK_USE_PLATFORM_ANDROID_KHR #ifdef VK_USE_PLATFORM_ANDROID_KHR
typedef struct { typedef struct {
VkIcdSurfaceBase base; VkIcdSurfaceBase base;
ANativeWindow *window; ANativeWindow *window;
} VkIcdSurfaceAndroid; } VkIcdSurfaceAndroid;
#endif // VK_USE_PLATFORM_ANDROID_KHR #endif /* VK_USE_PLATFORM_ANDROID_KHR */
#ifdef VK_USE_PLATFORM_MACOS_MVK #ifdef VK_USE_PLATFORM_MACOS_MVK
typedef struct { typedef struct {
VkIcdSurfaceBase base; VkIcdSurfaceBase base;
const void *pView; const void *pView;
} VkIcdSurfaceMacOS; } VkIcdSurfaceMacOS;
#endif // VK_USE_PLATFORM_MACOS_MVK #endif /* VK_USE_PLATFORM_MACOS_MVK */
#ifdef VK_USE_PLATFORM_IOS_MVK #ifdef VK_USE_PLATFORM_IOS_MVK
typedef struct { typedef struct {
VkIcdSurfaceBase base; VkIcdSurfaceBase base;
const void *pView; const void *pView;
} VkIcdSurfaceIOS; } VkIcdSurfaceIOS;
#endif // VK_USE_PLATFORM_IOS_MVK #endif /* VK_USE_PLATFORM_IOS_MVK */
typedef struct { typedef struct {
VkIcdSurfaceBase base; VkIcdSurfaceBase base;
@ -167,4 +167,4 @@ typedef struct {
VkExtent2D imageExtent; VkExtent2D imageExtent;
} VkIcdSurfaceDisplay; } VkIcdSurfaceDisplay;
#endif // VKICD_H #endif /* VKICD_H */

View File

@ -1,6 +1,5 @@
// /* File: vk_layer.h */
// File: vk_layer.h
//
/* /*
* Copyright (c) 2015-2017 The Khronos Group Inc. * Copyright (c) 2015-2017 The Khronos Group Inc.
* Copyright (c) 2015-2017 Valve Corporation * Copyright (c) 2015-2017 Valve Corporation
@ -35,28 +34,29 @@
#define VK_LAYER_EXPORT #define VK_LAYER_EXPORT
#endif #endif
// Definition for VkLayerDispatchTable and VkLayerInstanceDispatchTable now appear in externally generated header /* Definition for VkLayerDispatchTable and VkLayerInstanceDispatchTable now appear in externally generated header */
#include "vk_layer_dispatch_table.h" #include "vk_layer_dispatch_table.h"
#define MAX_NUM_UNKNOWN_EXTS 250 #define MAX_NUM_UNKNOWN_EXTS 250
// Loader-Layer version negotiation API. Versions add the following features: /* Loader-Layer version negotiation API. Versions add the following features:
// Versions 0/1 - Initial. Doesn't support vk_layerGetPhysicalDeviceProcAddr * Versions 0/1 - Initial. Doesn't support vk_layerGetPhysicalDeviceProcAddr
// or vk_icdNegotiateLoaderLayerInterfaceVersion. * or vk_icdNegotiateLoaderLayerInterfaceVersion.
// Version 2 - Add support for vk_layerGetPhysicalDeviceProcAddr and * Version 2 - Add support for vk_layerGetPhysicalDeviceProcAddr and
// vk_icdNegotiateLoaderLayerInterfaceVersion. * vk_icdNegotiateLoaderLayerInterfaceVersion.
*/
#define CURRENT_LOADER_LAYER_INTERFACE_VERSION 2 #define CURRENT_LOADER_LAYER_INTERFACE_VERSION 2
#define MIN_SUPPORTED_LOADER_LAYER_INTERFACE_VERSION 1 #define MIN_SUPPORTED_LOADER_LAYER_INTERFACE_VERSION 1
#define VK_CURRENT_CHAIN_VERSION 1 #define VK_CURRENT_CHAIN_VERSION 1
// Version negotiation values /* Version negotiation values */
typedef enum VkNegotiateLayerStructType { typedef enum VkNegotiateLayerStructType {
LAYER_NEGOTIATE_UNINTIALIZED = 0, LAYER_NEGOTIATE_UNINTIALIZED = 0,
LAYER_NEGOTIATE_INTERFACE_STRUCT = 1, LAYER_NEGOTIATE_INTERFACE_STRUCT = 1,
} VkNegotiateLayerStructType; } VkNegotiateLayerStructType;
// Version negotiation structures /* Version negotiation structures */
typedef struct VkNegotiateLayerInterface { typedef struct VkNegotiateLayerInterface {
VkNegotiateLayerStructType sType; VkNegotiateLayerStructType sType;
void *pNext; void *pNext;
@ -66,14 +66,14 @@ typedef struct VkNegotiateLayerInterface {
PFN_GetPhysicalDeviceProcAddr pfnGetPhysicalDeviceProcAddr; PFN_GetPhysicalDeviceProcAddr pfnGetPhysicalDeviceProcAddr;
} VkNegotiateLayerInterface; } VkNegotiateLayerInterface;
// Version negotiation functions /* Version negotiation functions */
typedef VkResult (VKAPI_PTR *PFN_vkNegotiateLoaderLayerInterfaceVersion)(VkNegotiateLayerInterface *pVersionStruct); typedef VkResult (VKAPI_PTR *PFN_vkNegotiateLoaderLayerInterfaceVersion)(VkNegotiateLayerInterface *pVersionStruct);
// Function prototype for unknown physical device extension command /* Function prototype for unknown physical device extension command */
typedef VkResult(VKAPI_PTR *PFN_PhysDevExt)(VkPhysicalDevice phys_device); typedef VkResult(VKAPI_PTR *PFN_PhysDevExt)(VkPhysicalDevice phys_device);
// ------------------------------------------------------------------------------------------------ /* ------------------------------------------------------------------------------------------------
// CreateInstance and CreateDevice support structures * CreateInstance and CreateDevice support structures */
/* Sub type of structure for instance and device loader ext of CreateInfo. /* Sub type of structure for instance and device loader ext of CreateInfo.
* When sType == VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO * When sType == VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO
@ -109,7 +109,7 @@ typedef VkResult (VKAPI_PTR *PFN_vkSetDeviceLoaderData)(VkDevice device,
void *object); void *object);
typedef struct { typedef struct {
VkStructureType sType; // VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO VkStructureType sType; /* VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO */
const void *pNext; const void *pNext;
VkLayerFunction function; VkLayerFunction function;
union { union {
@ -125,7 +125,7 @@ typedef struct VkLayerDeviceLink_ {
} VkLayerDeviceLink; } VkLayerDeviceLink;
typedef struct { typedef struct {
VkStructureType sType; // VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO VkStructureType sType; /* VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO */
const void *pNext; const void *pNext;
VkLayerFunction function; VkLayerFunction function;
union { union {

View File

@ -1,6 +1,5 @@
// /* File: vk_platform.h */
// File: vk_platform.h
//
/* /*
** Copyright (c) 2014-2017 The Khronos Group Inc. ** Copyright (c) 2014-2017 The Khronos Group Inc.
** **
@ -24,7 +23,7 @@
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
{ {
#endif // __cplusplus #endif /* __cplusplus */
/* /*
*************************************************************************************************** ***************************************************************************************************
@ -47,22 +46,23 @@ extern "C"
* Function pointer type: typedef void (VKAPI_PTR *PFN_vkCommand)(void); * Function pointer type: typedef void (VKAPI_PTR *PFN_vkCommand)(void);
*/ */
#if defined(_WIN32) #if defined(_WIN32)
// On Windows, Vulkan commands use the stdcall convention /* On Windows, Vulkan commands use the stdcall convention */
#define VKAPI_ATTR #define VKAPI_ATTR
#define VKAPI_CALL __stdcall #define VKAPI_CALL __stdcall
#define VKAPI_PTR VKAPI_CALL #define VKAPI_PTR VKAPI_CALL
#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH < 7 #elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH < 7
#error "Vulkan isn't supported for the 'armeabi' NDK ABI" #error "Vulkan isn't supported for the 'armeabi' NDK ABI"
#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7 && defined(__ARM_32BIT_STATE) #elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7 && defined(__ARM_32BIT_STATE)
// On Android 32-bit ARM targets, Vulkan functions use the "hardfloat" /* On Android 32-bit ARM targets, Vulkan functions use the "hardfloat"
// calling convention, i.e. float parameters are passed in registers. This * calling convention, i.e. float parameters are passed in registers. This
// is true even if the rest of the application passes floats on the stack, * is true even if the rest of the application passes floats on the stack,
// as it does by default when compiling for the armeabi-v7a NDK ABI. * as it does by default when compiling for the armeabi-v7a NDK ABI.
*/
#define VKAPI_ATTR __attribute__((pcs("aapcs-vfp"))) #define VKAPI_ATTR __attribute__((pcs("aapcs-vfp")))
#define VKAPI_CALL #define VKAPI_CALL
#define VKAPI_PTR VKAPI_ATTR #define VKAPI_PTR VKAPI_ATTR
#else #else
// On other platforms, use the default calling convention /* On other platforms, use the default calling convention */
#define VKAPI_ATTR #define VKAPI_ATTR
#define VKAPI_CALL #define VKAPI_CALL
#define VKAPI_PTR #define VKAPI_PTR
@ -83,10 +83,10 @@ extern "C"
#else #else
#include <stdint.h> #include <stdint.h>
#endif #endif
#endif // !defined(VK_NO_STDINT_H) #endif /* !defined(VK_NO_STDINT_H) */
#ifdef __cplusplus #ifdef __cplusplus
} // extern "C" } /* extern "C" */
#endif // __cplusplus #endif /* __cplusplus */
#endif #endif

View File

@ -1,6 +1,5 @@
// /* File: vk_sdk_platform.h */
// File: vk_sdk_platform.h
//
/* /*
* Copyright (c) 2015-2016 The Khronos Group Inc. * Copyright (c) 2015-2016 The Khronos Group Inc.
* Copyright (c) 2015-2016 Valve Corporation * Copyright (c) 2015-2016 Valve Corporation
@ -27,23 +26,23 @@
#ifndef __cplusplus #ifndef __cplusplus
#undef inline #undef inline
#define inline __inline #define inline __inline
#endif // __cplusplus #endif /* __cplusplus */
#if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/) #if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/)
// C99: /* C99:
// Microsoft didn't implement C99 in Visual Studio; but started adding it with * Microsoft didn't implement C99 in Visual Studio; but started adding it with
// VS2013. However, VS2013 still didn't have snprintf(). The following is a * VS2013. However, VS2013 still didn't have snprintf(). The following is a
// work-around (Note: The _CRT_SECURE_NO_WARNINGS macro must be set in the * work-around (Note: The _CRT_SECURE_NO_WARNINGS macro must be set in the
// "CMakeLists.txt" file). * "CMakeLists.txt" file).
// NOTE: This is fixed in Visual Studio 2015. * NOTE: This is fixed in Visual Studio 2015. */
#define snprintf _snprintf #define snprintf _snprintf
#endif #endif
#define strdup _strdup #define strdup _strdup
#endif // _WIN32 #endif /* _WIN32 */
// Check for noexcept support using clang, with fallback to Windows or GCC version numbers /* Check for noexcept support using clang, with fallback to Windows or GCC version numbers */
#ifndef NOEXCEPT #ifndef NOEXCEPT
#if defined(__clang__) #if defined(__clang__)
#if __has_feature(cxx_noexcept) #if __has_feature(cxx_noexcept)
@ -66,4 +65,4 @@
#endif #endif
#endif #endif
#endif // VK_SDK_PLATFORM_H #endif /* VK_SDK_PLATFORM_H */

View File

@ -76,4 +76,4 @@
#include "vulkan_xlib_xrandr.h" #include "vulkan_xlib_xrandr.h"
#endif #endif
#endif // VULKAN_H_ #endif /* VULKAN_H_ */

View File

@ -33,16 +33,18 @@ extern "C" {
#define VK_MAKE_VERSION(major, minor, patch) \ #define VK_MAKE_VERSION(major, minor, patch) \
(((major) << 22) | ((minor) << 12) | (patch)) (((major) << 22) | ((minor) << 12) | (patch))
// DEPRECATED: This define has been removed. Specific version defines (e.g. VK_API_VERSION_1_0), or the VK_MAKE_VERSION macro, should be used instead. /* DEPRECATED: This define has been removed. Specific version defines (e.g. VK_API_VERSION_1_0), or the VK_MAKE_VERSION macro, should be used instead. */
//#define VK_API_VERSION VK_MAKE_VERSION(1, 0, 0) // Patch version should always be set to 0 #if 0
#define VK_API_VERSION VK_MAKE_VERSION(1, 0, 0) /* Patch version should always be set to 0 */
#endif
// Vulkan 1.0 version number /* Vulkan 1.0 version number */
#define VK_API_VERSION_1_0 VK_MAKE_VERSION(1, 0, 0)// Patch version should always be set to 0 #define VK_API_VERSION_1_0 VK_MAKE_VERSION(1, 0, 0)/* Patch version should always be set to 0 */
#define VK_VERSION_MAJOR(version) ((uint32_t)(version) >> 22) #define VK_VERSION_MAJOR(version) ((uint32_t)(version) >> 22)
#define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12) & 0x3ff) #define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12) & 0x3ff)
#define VK_VERSION_PATCH(version) ((uint32_t)(version) & 0xfff) #define VK_VERSION_PATCH(version) ((uint32_t)(version) & 0xfff)
// Version of this file /* Version of this file */
#define VK_HEADER_VERSION 73 #define VK_HEADER_VERSION 73
@ -3654,9 +3656,8 @@ VKAPI_ATTR void VKAPI_CALL vkCmdExecuteCommands(
#endif #endif
#define VK_VERSION_1_1 1 #define VK_VERSION_1_1 1
// Vulkan 1.1 version number /* Vulkan 1.1 version number */
#define VK_API_VERSION_1_1 VK_MAKE_VERSION(1, 1, 0)// Patch version should always be set to 0 #define VK_API_VERSION_1_1 VK_MAKE_VERSION(1, 1, 0) /* Patch version should always be set to 0 */
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSamplerYcbcrConversion) VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSamplerYcbcrConversion)
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorUpdateTemplate) VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorUpdateTemplate)