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 (c) 2015-2019 The Khronos Group Inc.
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
20 * ---- Exceptions to the Apache 2.0 License: ----
22 * As an exception, if you use this Software to generate code and portions of
23 * this Software are embedded into the generated code as a result, you may
24 * redistribute such product without providing attribution as would otherwise
25 * be required by Sections 4(a), 4(b) and 4(d) of the License.
27 * In addition, if you combine or link code generated by this Software with
28 * software that is licensed under the GPLv2 or the LGPL v2.0 or 2.1
29 * ("`Combined Software`") and if a court of competent jurisdiction determines
30 * that the patent provision (Section 3), the indemnity provision (Section 9)
31 * or other Section of the License conflicts with the conditions of the
32 * applicable GPL or LGPL license, you may retroactively and prospectively
33 * choose to deem waived or otherwise exclude such Section(s) of the License,
34 * but only in their entirety and only with respect to the Combined Software.
38 #ifndef __WINE_VULKAN_DRIVER_H
39 #define __WINE_VULKAN_DRIVER_H
41 /* Wine internal vulkan driver version, needs to be bumped upon vulkan_funcs changes. */
42 #define WINE_VULKAN_DRIVER_VERSION 7
46 /* Vulkan global functions. These are the only calls at this point a graphics driver
47 * needs to provide. Other function calls will be provided indirectly by dispatch
48 * tables part of dispatchable Vulkan objects such as VkInstance or vkDevice.
50 VkResult (*p_vkCreateInstance
)(const VkInstanceCreateInfo
*, const VkAllocationCallbacks
*, VkInstance
*);
51 VkResult (*p_vkCreateSwapchainKHR
)(VkDevice
, const VkSwapchainCreateInfoKHR
*, const VkAllocationCallbacks
*, VkSwapchainKHR
*);
52 VkResult (*p_vkCreateWin32SurfaceKHR
)(VkInstance
, const VkWin32SurfaceCreateInfoKHR
*, const VkAllocationCallbacks
*, VkSurfaceKHR
*);
53 void (*p_vkDestroyInstance
)(VkInstance
, const VkAllocationCallbacks
*);
54 void (*p_vkDestroySurfaceKHR
)(VkInstance
, VkSurfaceKHR
, const VkAllocationCallbacks
*);
55 void (*p_vkDestroySwapchainKHR
)(VkDevice
, VkSwapchainKHR
, const VkAllocationCallbacks
*);
56 VkResult (*p_vkEnumerateInstanceExtensionProperties
)(const char *, uint32_t *, VkExtensionProperties
*);
57 VkResult (*p_vkGetDeviceGroupSurfacePresentModesKHR
)(VkDevice
, VkSurfaceKHR
, VkDeviceGroupPresentModeFlagsKHR
*);
58 void * (*p_vkGetDeviceProcAddr
)(VkDevice
, const char *);
59 void * (*p_vkGetInstanceProcAddr
)(VkInstance
, const char *);
60 VkResult (*p_vkGetPhysicalDevicePresentRectanglesKHR
)(VkPhysicalDevice
, VkSurfaceKHR
, uint32_t *, VkRect2D
*);
61 VkResult (*p_vkGetPhysicalDeviceSurfaceCapabilitiesKHR
)(VkPhysicalDevice
, VkSurfaceKHR
, VkSurfaceCapabilitiesKHR
*);
62 VkResult (*p_vkGetPhysicalDeviceSurfaceFormatsKHR
)(VkPhysicalDevice
, VkSurfaceKHR
, uint32_t *, VkSurfaceFormatKHR
*);
63 VkResult (*p_vkGetPhysicalDeviceSurfacePresentModesKHR
)(VkPhysicalDevice
, VkSurfaceKHR
, uint32_t *, VkPresentModeKHR
*);
64 VkResult (*p_vkGetPhysicalDeviceSurfaceSupportKHR
)(VkPhysicalDevice
, uint32_t, VkSurfaceKHR
, VkBool32
*);
65 VkBool32 (*p_vkGetPhysicalDeviceWin32PresentationSupportKHR
)(VkPhysicalDevice
, uint32_t);
66 VkResult (*p_vkGetSwapchainImagesKHR
)(VkDevice
, VkSwapchainKHR
, uint32_t *, VkImage
*);
67 VkResult (*p_vkQueuePresentKHR
)(VkQueue
, const VkPresentInfoKHR
*);
70 extern const struct vulkan_funcs
* CDECL
__wine_get_vulkan_driver(HDC hdc
, UINT version
);
72 static inline void *get_vulkan_driver_device_proc_addr(
73 const struct vulkan_funcs
*vulkan_funcs
, const char *name
)
75 if (!name
|| name
[0] != 'v' || name
[1] != 'k') return NULL
;
79 if (!strcmp(name
, "CreateSwapchainKHR"))
80 return vulkan_funcs
->p_vkCreateSwapchainKHR
;
81 if (!strcmp(name
, "DestroySwapchainKHR"))
82 return vulkan_funcs
->p_vkDestroySwapchainKHR
;
83 if (!strcmp(name
, "GetDeviceGroupSurfacePresentModesKHR"))
84 return vulkan_funcs
->p_vkGetDeviceGroupSurfacePresentModesKHR
;
85 if (!strcmp(name
, "GetDeviceProcAddr"))
86 return vulkan_funcs
->p_vkGetDeviceProcAddr
;
87 if (!strcmp(name
, "GetSwapchainImagesKHR"))
88 return vulkan_funcs
->p_vkGetSwapchainImagesKHR
;
89 if (!strcmp(name
, "QueuePresentKHR"))
90 return vulkan_funcs
->p_vkQueuePresentKHR
;
95 static inline void *get_vulkan_driver_instance_proc_addr(
96 const struct vulkan_funcs
*vulkan_funcs
, VkInstance instance
, const char *name
)
98 if (!name
|| name
[0] != 'v' || name
[1] != 'k') return NULL
;
102 if (!strcmp(name
, "CreateInstance"))
103 return vulkan_funcs
->p_vkCreateInstance
;
104 if (!strcmp(name
, "EnumerateInstanceExtensionProperties"))
105 return vulkan_funcs
->p_vkEnumerateInstanceExtensionProperties
;
107 if (!instance
) return NULL
;
109 if (!strcmp(name
, "CreateWin32SurfaceKHR"))
110 return vulkan_funcs
->p_vkCreateWin32SurfaceKHR
;
111 if (!strcmp(name
, "DestroyInstance"))
112 return vulkan_funcs
->p_vkDestroyInstance
;
113 if (!strcmp(name
, "DestroySurfaceKHR"))
114 return vulkan_funcs
->p_vkDestroySurfaceKHR
;
115 if (!strcmp(name
, "GetInstanceProcAddr"))
116 return vulkan_funcs
->p_vkGetInstanceProcAddr
;
117 if (!strcmp(name
, "GetPhysicalDevicePresentRectanglesKHR"))
118 return vulkan_funcs
->p_vkGetPhysicalDevicePresentRectanglesKHR
;
119 if (!strcmp(name
, "GetPhysicalDeviceSurfaceCapabilitiesKHR"))
120 return vulkan_funcs
->p_vkGetPhysicalDeviceSurfaceCapabilitiesKHR
;
121 if (!strcmp(name
, "GetPhysicalDeviceSurfaceFormatsKHR"))
122 return vulkan_funcs
->p_vkGetPhysicalDeviceSurfaceFormatsKHR
;
123 if (!strcmp(name
, "GetPhysicalDeviceSurfacePresentModesKHR"))
124 return vulkan_funcs
->p_vkGetPhysicalDeviceSurfacePresentModesKHR
;
125 if (!strcmp(name
, "GetPhysicalDeviceSurfaceSupportKHR"))
126 return vulkan_funcs
->p_vkGetPhysicalDeviceSurfaceSupportKHR
;
127 if (!strcmp(name
, "GetPhysicalDeviceWin32PresentationSupportKHR"))
128 return vulkan_funcs
->p_vkGetPhysicalDeviceWin32PresentationSupportKHR
;
132 return get_vulkan_driver_device_proc_addr(vulkan_funcs
, name
);
135 #endif /* __WINE_VULKAN_DRIVER_H */