Ian Elliott | d3ef02f | 2015-07-06 14:36:13 -0600 | [diff] [blame] | 1 | /* |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 2 | * Copyright (c) 2015-2016 The Khronos Group Inc. |
| 3 | * Copyright (c) 2015-2016 Valve Corporation |
| 4 | * Copyright (c) 2015-2016 LunarG, Inc. |
Ian Elliott | d3ef02f | 2015-07-06 14:36:13 -0600 | [diff] [blame] | 5 | * |
Jon Ashburn | 3ebf125 | 2016-04-19 11:30:31 -0600 | [diff] [blame] | 6 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | * you may not use this file except in compliance with the License. |
| 8 | * You may obtain a copy of the License at |
Ian Elliott | d3ef02f | 2015-07-06 14:36:13 -0600 | [diff] [blame] | 9 | * |
Jon Ashburn | 3ebf125 | 2016-04-19 11:30:31 -0600 | [diff] [blame] | 10 | * http://www.apache.org/licenses/LICENSE-2.0 |
Ian Elliott | d3ef02f | 2015-07-06 14:36:13 -0600 | [diff] [blame] | 11 | * |
Jon Ashburn | 3ebf125 | 2016-04-19 11:30:31 -0600 | [diff] [blame] | 12 | * Unless required by applicable law or agreed to in writing, software |
| 13 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | * See the License for the specific language governing permissions and |
| 16 | * limitations under the License. |
Ian Elliott | d3ef02f | 2015-07-06 14:36:13 -0600 | [diff] [blame] | 17 | * |
Courtney Goeltzenleuchter | 0555952 | 2015-10-30 11:14:30 -0600 | [diff] [blame] | 18 | * Author: Ian Elliott <ian@lunarg.com> |
| 19 | * |
Ian Elliott | d3ef02f | 2015-07-06 14:36:13 -0600 | [diff] [blame] | 20 | */ |
| 21 | |
Piers Daniell | f9262be | 2016-09-14 11:24:36 -0600 | [diff] [blame] | 22 | #ifndef WSI_H |
| 23 | #define WSI_H |
| 24 | |
Ian Elliott | d3ef02f | 2015-07-06 14:36:13 -0600 | [diff] [blame] | 25 | #include "vk_loader_platform.h" |
| 26 | #include "loader.h" |
Ian Elliott | d3ef02f | 2015-07-06 14:36:13 -0600 | [diff] [blame] | 27 | |
Piers Daniell | f9262be | 2016-09-14 11:24:36 -0600 | [diff] [blame] | 28 | typedef struct { |
| 29 | union { |
| 30 | #ifdef VK_USE_PLATFORM_MIR_KHR |
| 31 | VkIcdSurfaceMir mir_surf; |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 32 | #endif // VK_USE_PLATFORM_MIR_KHR |
Piers Daniell | f9262be | 2016-09-14 11:24:36 -0600 | [diff] [blame] | 33 | #ifdef VK_USE_PLATFORM_WAYLAND_KHR |
| 34 | VkIcdSurfaceWayland wayland_surf; |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 35 | #endif // VK_USE_PLATFORM_WAYLAND_KHR |
Piers Daniell | f9262be | 2016-09-14 11:24:36 -0600 | [diff] [blame] | 36 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 37 | VkIcdSurfaceWin32 win_surf; |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 38 | #endif // VK_USE_PLATFORM_WIN32_KHR |
Piers Daniell | f9262be | 2016-09-14 11:24:36 -0600 | [diff] [blame] | 39 | #ifdef VK_USE_PLATFORM_XCB_KHR |
| 40 | VkIcdSurfaceXcb xcb_surf; |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 41 | #endif // VK_USE_PLATFORM_XCB_KHR |
Piers Daniell | f9262be | 2016-09-14 11:24:36 -0600 | [diff] [blame] | 42 | #ifdef VK_USE_PLATFORM_XLIB_KHR |
| 43 | VkIcdSurfaceXlib xlib_surf; |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 44 | #endif // VK_USE_PLATFORM_XLIB_KHR |
Karl Schultz | 2e5ed33 | 2017-12-12 10:33:01 -0500 | [diff] [blame] | 45 | #ifdef VK_USE_PLATFORM_MACOS_MVK |
| 46 | VkIcdSurfaceMacOS macos_surf; |
| 47 | #endif // VK_USE_PLATFORM_MACOS_MVK |
Piers Daniell | f9262be | 2016-09-14 11:24:36 -0600 | [diff] [blame] | 48 | VkIcdSurfaceDisplay display_surf; |
| 49 | }; |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 50 | uint32_t base_size; // Size of VkIcdSurfaceBase |
| 51 | uint32_t platform_size; // Size of corresponding VkIcdSurfaceXXX |
| 52 | uint32_t non_platform_offset; // Start offset to base_size |
| 53 | uint32_t entire_size; // Size of entire VkIcdSurface |
Piers Daniell | f9262be | 2016-09-14 11:24:36 -0600 | [diff] [blame] | 54 | VkSurfaceKHR *real_icd_surfaces; |
| 55 | } VkIcdSurface; |
| 56 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 57 | bool wsi_swapchain_instance_gpa(struct loader_instance *ptr_instance, const char *name, void **addr); |
Ian Elliott | d3ef02f | 2015-07-06 14:36:13 -0600 | [diff] [blame] | 58 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 59 | void wsi_create_instance(struct loader_instance *ptr_instance, const VkInstanceCreateInfo *pCreateInfo); |
Jon Ashburn | 6fa520f | 2016-03-25 12:49:35 -0600 | [diff] [blame] | 60 | bool wsi_unsupported_instance_extension(const VkExtensionProperties *ext_prop); |
Ian Elliott | d3ef02f | 2015-07-06 14:36:13 -0600 | [diff] [blame] | 61 | |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 62 | VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo, |
| 63 | const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchain); |
Mark Young | 16573c7 | 2016-06-28 10:52:43 -0600 | [diff] [blame] | 64 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 65 | VKAPI_ATTR void VKAPI_CALL terminator_DestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface, |
| 66 | const VkAllocationCallbacks *pAllocator); |
Ian Elliott | d3ef02f | 2015-07-06 14:36:13 -0600 | [diff] [blame] | 67 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 68 | VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, |
| 69 | uint32_t queueFamilyIndex, VkSurfaceKHR surface, |
| 70 | VkBool32 *pSupported); |
Ian Elliott | 486c550 | 2015-11-19 16:05:09 -0700 | [diff] [blame] | 71 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 72 | VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, |
| 73 | VkSurfaceKHR surface, |
| 74 | VkSurfaceCapabilitiesKHR *pSurfaceCapabilities); |
Ian Elliott | 486c550 | 2015-11-19 16:05:09 -0700 | [diff] [blame] | 75 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 76 | VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, |
| 77 | uint32_t *pSurfaceFormatCount, |
| 78 | VkSurfaceFormatKHR *pSurfaceFormats); |
Ian Elliott | 486c550 | 2015-11-19 16:05:09 -0700 | [diff] [blame] | 79 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 80 | VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, |
| 81 | VkSurfaceKHR surface, uint32_t *pPresentModeCount, |
| 82 | VkPresentModeKHR *pPresentModes); |
Ian Elliott | 919fa30 | 2015-11-24 15:39:10 -0700 | [diff] [blame] | 83 | |
| 84 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 85 | VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateWin32SurfaceKHR(VkInstance instance, const VkWin32SurfaceCreateInfoKHR *pCreateInfo, |
| 86 | const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface); |
| 87 | VKAPI_ATTR VkBool32 VKAPI_CALL terminator_GetPhysicalDeviceWin32PresentationSupportKHR(VkPhysicalDevice physicalDevice, |
| 88 | uint32_t queueFamilyIndex); |
Ian Elliott | 919fa30 | 2015-11-24 15:39:10 -0700 | [diff] [blame] | 89 | #endif |
| 90 | #ifdef VK_USE_PLATFORM_MIR_KHR |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 91 | VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateMirSurfaceKHR(VkInstance instance, const VkMirSurfaceCreateInfoKHR *pCreateInfo, |
| 92 | const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface); |
| 93 | VKAPI_ATTR VkBool32 VKAPI_CALL terminator_GetPhysicalDeviceMirPresentationSupportKHR(VkPhysicalDevice physicalDevice, |
| 94 | uint32_t queueFamilyIndex, |
| 95 | MirConnection *connection); |
Ian Elliott | 919fa30 | 2015-11-24 15:39:10 -0700 | [diff] [blame] | 96 | #endif |
| 97 | #ifdef VK_USE_PLATFORM_WAYLAND_KHR |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 98 | VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateWaylandSurfaceKHR(VkInstance instance, |
| 99 | const VkWaylandSurfaceCreateInfoKHR *pCreateInfo, |
| 100 | const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface); |
| 101 | VKAPI_ATTR VkBool32 VKAPI_CALL terminator_GetPhysicalDeviceWaylandPresentationSupportKHR(VkPhysicalDevice physicalDevice, |
| 102 | uint32_t queueFamilyIndex, |
| 103 | struct wl_display *display); |
Ian Elliott | 919fa30 | 2015-11-24 15:39:10 -0700 | [diff] [blame] | 104 | #endif |
| 105 | #ifdef VK_USE_PLATFORM_XCB_KHR |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 106 | VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateXcbSurfaceKHR(VkInstance instance, const VkXcbSurfaceCreateInfoKHR *pCreateInfo, |
| 107 | const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface); |
Jon Ashburn | f72a04b | 2015-11-25 17:55:49 -0700 | [diff] [blame] | 108 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 109 | VKAPI_ATTR VkBool32 VKAPI_CALL terminator_GetPhysicalDeviceXcbPresentationSupportKHR(VkPhysicalDevice physicalDevice, |
| 110 | uint32_t queueFamilyIndex, |
| 111 | xcb_connection_t *connection, |
| 112 | xcb_visualid_t visual_id); |
Ian Elliott | 919fa30 | 2015-11-24 15:39:10 -0700 | [diff] [blame] | 113 | #endif |
| 114 | #ifdef VK_USE_PLATFORM_XLIB_KHR |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 115 | VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateXlibSurfaceKHR(VkInstance instance, const VkXlibSurfaceCreateInfoKHR *pCreateInfo, |
| 116 | const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface); |
| 117 | VKAPI_ATTR VkBool32 VKAPI_CALL terminator_GetPhysicalDeviceXlibPresentationSupportKHR(VkPhysicalDevice physicalDevice, |
| 118 | uint32_t queueFamilyIndex, Display *dpy, |
| 119 | VisualID visualID); |
Ian Elliott | 919fa30 | 2015-11-24 15:39:10 -0700 | [diff] [blame] | 120 | #endif |
Karl Schultz | 2e5ed33 | 2017-12-12 10:33:01 -0500 | [diff] [blame] | 121 | #ifdef VK_USE_PLATFORM_MACOS_MVK |
| 122 | VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateMacOSSurfaceMVK(VkInstance instance, const VkMacOSSurfaceCreateInfoMVK *pCreateInfo, |
| 123 | const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface); |
| 124 | #endif |
| 125 | #ifdef VK_USE_PLATFORM_IOS_MVK |
| 126 | VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateIOSSurfaceMVK(VkInstance instance, const VkIOSSurfaceCreateInfoMVK *pCreateInfo, |
| 127 | const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface); |
| 128 | #endif |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 129 | VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceDisplayPropertiesKHR(VkPhysicalDevice physicalDevice, |
| 130 | uint32_t *pPropertyCount, |
| 131 | VkDisplayPropertiesKHR *pProperties); |
| 132 | VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceDisplayPlanePropertiesKHR(VkPhysicalDevice physicalDevice, |
| 133 | uint32_t *pPropertyCount, |
| 134 | VkDisplayPlanePropertiesKHR *pProperties); |
| 135 | VKAPI_ATTR VkResult VKAPI_CALL terminator_GetDisplayPlaneSupportedDisplaysKHR(VkPhysicalDevice physicalDevice, uint32_t planeIndex, |
| 136 | uint32_t *pDisplayCount, VkDisplayKHR *pDisplays); |
| 137 | VKAPI_ATTR VkResult VKAPI_CALL terminator_GetDisplayModePropertiesKHR(VkPhysicalDevice physicalDevice, VkDisplayKHR display, |
| 138 | uint32_t *pPropertyCount, |
| 139 | VkDisplayModePropertiesKHR *pProperties); |
| 140 | VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDisplayModeKHR(VkPhysicalDevice physicalDevice, VkDisplayKHR display, |
| 141 | const VkDisplayModeCreateInfoKHR *pCreateInfo, |
| 142 | const VkAllocationCallbacks *pAllocator, VkDisplayModeKHR *pMode); |
| 143 | VKAPI_ATTR VkResult VKAPI_CALL terminator_GetDisplayPlaneCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkDisplayModeKHR mode, |
| 144 | uint32_t planeIndex, |
| 145 | VkDisplayPlaneCapabilitiesKHR *pCapabilities); |
| 146 | VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDisplayPlaneSurfaceKHR(VkInstance instance, |
| 147 | const VkDisplaySurfaceCreateInfoKHR *pCreateInfo, |
| 148 | const VkAllocationCallbacks *pAllocator, |
| 149 | VkSurfaceKHR *pSurface); |
Piers Daniell | f9262be | 2016-09-14 11:24:36 -0600 | [diff] [blame] | 150 | |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 151 | VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateSharedSwapchainsKHR(VkDevice device, uint32_t swapchainCount, |
| 152 | const VkSwapchainCreateInfoKHR *pCreateInfos, |
| 153 | const VkAllocationCallbacks *pAllocator, |
| 154 | VkSwapchainKHR *pSwapchains); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 155 | |
Lenny Komow | 82e15e0 | 2017-10-02 15:08:53 -0600 | [diff] [blame^] | 156 | VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDevicePresentRectanglesKHR(VkPhysicalDevice physicalDevice, |
| 157 | VkSurfaceKHR surface, |
| 158 | uint32_t* pRectCount, |
| 159 | VkRect2D* pRects); |
| 160 | |
| 161 | #endif // WSI_H |