1 /* Automatically generated from Vulkan vk.xml; DO NOT EDIT!
3 * This file is generated from Vulkan vk.xml file covered
4 * by the following copyright and permission notice:
6 * Copyright 2015-2023 The Khronos Group Inc.
8 * SPDX-License-Identifier: Apache-2.0 OR MIT
12 #ifndef __WINE_VULKAN_DRIVER_H
13 #define __WINE_VULKAN_DRIVER_H
15 /* Wine internal vulkan driver version, needs to be bumped upon vulkan_funcs changes. */
16 #define WINE_VULKAN_DRIVER_VERSION 11
20 /* Vulkan global functions. These are the only calls at this point a graphics driver
21 * needs to provide. Other function calls will be provided indirectly by dispatch
22 * tables part of dispatchable Vulkan objects such as VkInstance or vkDevice.
24 VkResult (*p_vkCreateInstance
)(const VkInstanceCreateInfo
*, const VkAllocationCallbacks
*, VkInstance
*);
25 VkResult (*p_vkCreateSwapchainKHR
)(VkDevice
, const VkSwapchainCreateInfoKHR
*, const VkAllocationCallbacks
*, VkSwapchainKHR
*);
26 VkResult (*p_vkCreateWin32SurfaceKHR
)(VkInstance
, const VkWin32SurfaceCreateInfoKHR
*, const VkAllocationCallbacks
*, VkSurfaceKHR
*);
27 void (*p_vkDestroyInstance
)(VkInstance
, const VkAllocationCallbacks
*);
28 void (*p_vkDestroySurfaceKHR
)(VkInstance
, VkSurfaceKHR
, const VkAllocationCallbacks
*);
29 void (*p_vkDestroySwapchainKHR
)(VkDevice
, VkSwapchainKHR
, const VkAllocationCallbacks
*);
30 VkResult (*p_vkEnumerateInstanceExtensionProperties
)(const char *, uint32_t *, VkExtensionProperties
*);
31 VkResult (*p_vkGetDeviceGroupSurfacePresentModesKHR
)(VkDevice
, VkSurfaceKHR
, VkDeviceGroupPresentModeFlagsKHR
*);
32 void * (*p_vkGetDeviceProcAddr
)(VkDevice
, const char *);
33 void * (*p_vkGetInstanceProcAddr
)(VkInstance
, const char *);
34 VkResult (*p_vkGetPhysicalDevicePresentRectanglesKHR
)(VkPhysicalDevice
, VkSurfaceKHR
, uint32_t *, VkRect2D
*);
35 VkResult (*p_vkGetPhysicalDeviceSurfaceCapabilities2KHR
)(VkPhysicalDevice
, const VkPhysicalDeviceSurfaceInfo2KHR
*, VkSurfaceCapabilities2KHR
*);
36 VkResult (*p_vkGetPhysicalDeviceSurfaceCapabilitiesKHR
)(VkPhysicalDevice
, VkSurfaceKHR
, VkSurfaceCapabilitiesKHR
*);
37 VkResult (*p_vkGetPhysicalDeviceSurfaceFormats2KHR
)(VkPhysicalDevice
, const VkPhysicalDeviceSurfaceInfo2KHR
*, uint32_t *, VkSurfaceFormat2KHR
*);
38 VkResult (*p_vkGetPhysicalDeviceSurfaceFormatsKHR
)(VkPhysicalDevice
, VkSurfaceKHR
, uint32_t *, VkSurfaceFormatKHR
*);
39 VkResult (*p_vkGetPhysicalDeviceSurfacePresentModesKHR
)(VkPhysicalDevice
, VkSurfaceKHR
, uint32_t *, VkPresentModeKHR
*);
40 VkResult (*p_vkGetPhysicalDeviceSurfaceSupportKHR
)(VkPhysicalDevice
, uint32_t, VkSurfaceKHR
, VkBool32
*);
41 VkBool32 (*p_vkGetPhysicalDeviceWin32PresentationSupportKHR
)(VkPhysicalDevice
, uint32_t);
42 VkResult (*p_vkGetSwapchainImagesKHR
)(VkDevice
, VkSwapchainKHR
, uint32_t *, VkImage
*);
43 VkResult (*p_vkQueuePresentKHR
)(VkQueue
, const VkPresentInfoKHR
*);
45 /* winevulkan specific functions */
46 VkSurfaceKHR (*p_wine_get_native_surface
)(VkSurfaceKHR
);
49 extern const struct vulkan_funcs
* __wine_get_vulkan_driver(UINT version
);
51 static inline void *get_vulkan_driver_device_proc_addr(
52 const struct vulkan_funcs
*vulkan_funcs
, const char *name
)
54 if (!name
|| name
[0] != 'v' || name
[1] != 'k') return NULL
;
58 if (!strcmp(name
, "CreateSwapchainKHR"))
59 return vulkan_funcs
->p_vkCreateSwapchainKHR
;
60 if (!strcmp(name
, "DestroySwapchainKHR"))
61 return vulkan_funcs
->p_vkDestroySwapchainKHR
;
62 if (!strcmp(name
, "GetDeviceGroupSurfacePresentModesKHR"))
63 return vulkan_funcs
->p_vkGetDeviceGroupSurfacePresentModesKHR
;
64 if (!strcmp(name
, "GetDeviceProcAddr"))
65 return vulkan_funcs
->p_vkGetDeviceProcAddr
;
66 if (!strcmp(name
, "GetSwapchainImagesKHR"))
67 return vulkan_funcs
->p_vkGetSwapchainImagesKHR
;
68 if (!strcmp(name
, "QueuePresentKHR"))
69 return vulkan_funcs
->p_vkQueuePresentKHR
;
74 static inline void *get_vulkan_driver_instance_proc_addr(
75 const struct vulkan_funcs
*vulkan_funcs
, VkInstance instance
, const char *name
)
77 if (!name
|| name
[0] != 'v' || name
[1] != 'k') return NULL
;
81 if (!strcmp(name
, "CreateInstance"))
82 return vulkan_funcs
->p_vkCreateInstance
;
83 if (!strcmp(name
, "EnumerateInstanceExtensionProperties"))
84 return vulkan_funcs
->p_vkEnumerateInstanceExtensionProperties
;
86 if (!instance
) return NULL
;
88 if (!strcmp(name
, "CreateWin32SurfaceKHR"))
89 return vulkan_funcs
->p_vkCreateWin32SurfaceKHR
;
90 if (!strcmp(name
, "DestroyInstance"))
91 return vulkan_funcs
->p_vkDestroyInstance
;
92 if (!strcmp(name
, "DestroySurfaceKHR"))
93 return vulkan_funcs
->p_vkDestroySurfaceKHR
;
94 if (!strcmp(name
, "GetInstanceProcAddr"))
95 return vulkan_funcs
->p_vkGetInstanceProcAddr
;
96 if (!strcmp(name
, "GetPhysicalDevicePresentRectanglesKHR"))
97 return vulkan_funcs
->p_vkGetPhysicalDevicePresentRectanglesKHR
;
98 if (!strcmp(name
, "GetPhysicalDeviceSurfaceCapabilities2KHR"))
99 return vulkan_funcs
->p_vkGetPhysicalDeviceSurfaceCapabilities2KHR
;
100 if (!strcmp(name
, "GetPhysicalDeviceSurfaceCapabilitiesKHR"))
101 return vulkan_funcs
->p_vkGetPhysicalDeviceSurfaceCapabilitiesKHR
;
102 if (!strcmp(name
, "GetPhysicalDeviceSurfaceFormats2KHR"))
103 return vulkan_funcs
->p_vkGetPhysicalDeviceSurfaceFormats2KHR
;
104 if (!strcmp(name
, "GetPhysicalDeviceSurfaceFormatsKHR"))
105 return vulkan_funcs
->p_vkGetPhysicalDeviceSurfaceFormatsKHR
;
106 if (!strcmp(name
, "GetPhysicalDeviceSurfacePresentModesKHR"))
107 return vulkan_funcs
->p_vkGetPhysicalDeviceSurfacePresentModesKHR
;
108 if (!strcmp(name
, "GetPhysicalDeviceSurfaceSupportKHR"))
109 return vulkan_funcs
->p_vkGetPhysicalDeviceSurfaceSupportKHR
;
110 if (!strcmp(name
, "GetPhysicalDeviceWin32PresentationSupportKHR"))
111 return vulkan_funcs
->p_vkGetPhysicalDeviceWin32PresentationSupportKHR
;
115 return get_vulkan_driver_device_proc_addr(vulkan_funcs
, name
);
118 #endif /* __WINE_VULKAN_DRIVER_H */