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; |
| 32 | #endif // VK_USE_PLATFORM_MIR_KHR |
| 33 | #ifdef VK_USE_PLATFORM_WAYLAND_KHR |
| 34 | VkIcdSurfaceWayland wayland_surf; |
| 35 | #endif // VK_USE_PLATFORM_WAYLAND_KHR |
| 36 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 37 | VkIcdSurfaceWin32 win_surf; |
| 38 | #endif // VK_USE_PLATFORM_WIN32_KHR |
| 39 | #ifdef VK_USE_PLATFORM_XCB_KHR |
| 40 | VkIcdSurfaceXcb xcb_surf; |
| 41 | #endif // VK_USE_PLATFORM_XCB_KHR |
| 42 | #ifdef VK_USE_PLATFORM_XLIB_KHR |
| 43 | VkIcdSurfaceXlib xlib_surf; |
| 44 | #endif // VK_USE_PLATFORM_XLIB_KHR |
| 45 | VkIcdSurfaceDisplay display_surf; |
| 46 | }; |
| 47 | uint32_t base_size; // Size of VkIcdSurfaceBase |
| 48 | uint32_t platform_size; // Size of corresponding VkIcdSurfaceXXX |
| 49 | uint32_t non_platform_offset; // Start offset to base_size |
| 50 | uint32_t entire_size; // Size of entire VkIcdSurface |
| 51 | VkSurfaceKHR *real_icd_surfaces; |
| 52 | } VkIcdSurface; |
| 53 | |
Jon Ashburn | 8a39efc | 2015-11-06 11:02:40 -0700 | [diff] [blame] | 54 | bool wsi_swapchain_instance_gpa(struct loader_instance *ptr_instance, |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 55 | const char *name, void **addr); |
Ian Elliott | d3ef02f | 2015-07-06 14:36:13 -0600 | [diff] [blame] | 56 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 57 | void wsi_create_instance(struct loader_instance *ptr_instance, |
| 58 | const VkInstanceCreateInfo *pCreateInfo); |
Jon Ashburn | 6fa520f | 2016-03-25 12:49:35 -0600 | [diff] [blame] | 59 | bool wsi_unsupported_instance_extension(const VkExtensionProperties *ext_prop); |
Ian Elliott | d3ef02f | 2015-07-06 14:36:13 -0600 | [diff] [blame] | 60 | |
Mark Young | 16573c7 | 2016-06-28 10:52:43 -0600 | [diff] [blame] | 61 | VKAPI_ATTR VkResult VKAPI_CALL terminator_vkCreateSwapchainKHR( |
| 62 | VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo, |
| 63 | const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchain); |
| 64 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 65 | VKAPI_ATTR void VKAPI_CALL |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 66 | terminator_DestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface, |
| 67 | const VkAllocationCallbacks *pAllocator); |
Ian Elliott | d3ef02f | 2015-07-06 14:36:13 -0600 | [diff] [blame] | 68 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 69 | VKAPI_ATTR VkResult VKAPI_CALL |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 70 | terminator_GetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, |
| 71 | uint32_t queueFamilyIndex, |
| 72 | VkSurfaceKHR surface, |
| 73 | VkBool32 *pSupported); |
Ian Elliott | 486c550 | 2015-11-19 16:05:09 -0700 | [diff] [blame] | 74 | |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 75 | VKAPI_ATTR VkResult VKAPI_CALL |
| 76 | terminator_GetPhysicalDeviceSurfaceCapabilitiesKHR( |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 77 | VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, |
| 78 | VkSurfaceCapabilitiesKHR *pSurfaceCapabilities); |
Ian Elliott | 486c550 | 2015-11-19 16:05:09 -0700 | [diff] [blame] | 79 | |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 80 | VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceFormatsKHR( |
| 81 | VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, |
| 82 | uint32_t *pSurfaceFormatCount, VkSurfaceFormatKHR *pSurfaceFormats); |
Ian Elliott | 486c550 | 2015-11-19 16:05:09 -0700 | [diff] [blame] | 83 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 84 | VKAPI_ATTR VkResult VKAPI_CALL |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 85 | terminator_GetPhysicalDeviceSurfacePresentModesKHR( |
| 86 | VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, |
| 87 | uint32_t *pPresentModeCount, VkPresentModeKHR *pPresentModes); |
Ian Elliott | 919fa30 | 2015-11-24 15:39:10 -0700 | [diff] [blame] | 88 | |
| 89 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 90 | VKAPI_ATTR VkResult VKAPI_CALL |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 91 | terminator_CreateWin32SurfaceKHR(VkInstance instance, |
| 92 | const VkWin32SurfaceCreateInfoKHR *pCreateInfo, |
| 93 | const VkAllocationCallbacks *pAllocator, |
| 94 | VkSurfaceKHR *pSurface); |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 95 | VKAPI_ATTR VkBool32 VKAPI_CALL |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 96 | terminator_GetPhysicalDeviceWin32PresentationSupportKHR( |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 97 | VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex); |
Ian Elliott | 919fa30 | 2015-11-24 15:39:10 -0700 | [diff] [blame] | 98 | #endif |
| 99 | #ifdef VK_USE_PLATFORM_MIR_KHR |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 100 | VKAPI_ATTR VkResult VKAPI_CALL |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 101 | terminator_CreateMirSurfaceKHR(VkInstance instance, |
| 102 | const VkMirSurfaceCreateInfoKHR *pCreateInfo, |
| 103 | const VkAllocationCallbacks *pAllocator, |
| 104 | VkSurfaceKHR *pSurface); |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 105 | VKAPI_ATTR VkBool32 VKAPI_CALL |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 106 | terminator_GetPhysicalDeviceMirPresentationSupportKHR( |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 107 | VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, |
| 108 | MirConnection *connection); |
Ian Elliott | 919fa30 | 2015-11-24 15:39:10 -0700 | [diff] [blame] | 109 | #endif |
| 110 | #ifdef VK_USE_PLATFORM_WAYLAND_KHR |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 111 | VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateWaylandSurfaceKHR( |
| 112 | VkInstance instance, const VkWaylandSurfaceCreateInfoKHR *pCreateInfo, |
| 113 | const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface); |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 114 | VKAPI_ATTR VkBool32 VKAPI_CALL |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 115 | terminator_GetPhysicalDeviceWaylandPresentationSupportKHR( |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 116 | VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, |
| 117 | struct wl_display *display); |
Ian Elliott | 919fa30 | 2015-11-24 15:39:10 -0700 | [diff] [blame] | 118 | #endif |
| 119 | #ifdef VK_USE_PLATFORM_XCB_KHR |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 120 | VKAPI_ATTR VkResult VKAPI_CALL |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 121 | terminator_CreateXcbSurfaceKHR(VkInstance instance, |
| 122 | const VkXcbSurfaceCreateInfoKHR *pCreateInfo, |
| 123 | const VkAllocationCallbacks *pAllocator, |
| 124 | VkSurfaceKHR *pSurface); |
Jon Ashburn | f72a04b | 2015-11-25 17:55:49 -0700 | [diff] [blame] | 125 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 126 | VKAPI_ATTR VkBool32 VKAPI_CALL |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 127 | terminator_GetPhysicalDeviceXcbPresentationSupportKHR( |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 128 | VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, |
| 129 | xcb_connection_t *connection, xcb_visualid_t visual_id); |
Ian Elliott | 919fa30 | 2015-11-24 15:39:10 -0700 | [diff] [blame] | 130 | #endif |
| 131 | #ifdef VK_USE_PLATFORM_XLIB_KHR |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 132 | VKAPI_ATTR VkResult VKAPI_CALL |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 133 | terminator_CreateXlibSurfaceKHR(VkInstance instance, |
| 134 | const VkXlibSurfaceCreateInfoKHR *pCreateInfo, |
| 135 | const VkAllocationCallbacks *pAllocator, |
| 136 | VkSurfaceKHR *pSurface); |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 137 | VKAPI_ATTR VkBool32 VKAPI_CALL |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 138 | terminator_GetPhysicalDeviceXlibPresentationSupportKHR( |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 139 | VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, Display *dpy, |
| 140 | VisualID visualID); |
Ian Elliott | 919fa30 | 2015-11-24 15:39:10 -0700 | [diff] [blame] | 141 | #endif |
Jon Ashburn | cc407a2 | 2016-04-15 09:25:03 -0600 | [diff] [blame] | 142 | VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceDisplayPropertiesKHR( |
| 143 | VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, |
| 144 | VkDisplayPropertiesKHR *pProperties); |
Jon Ashburn | c7d3e73 | 2016-03-08 09:30:30 -0700 | [diff] [blame] | 145 | VKAPI_ATTR VkResult VKAPI_CALL |
| 146 | terminator_GetPhysicalDeviceDisplayPlanePropertiesKHR( |
Jon Ashburn | cc407a2 | 2016-04-15 09:25:03 -0600 | [diff] [blame] | 147 | VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, |
| 148 | VkDisplayPlanePropertiesKHR *pProperties); |
Jon Ashburn | c7d3e73 | 2016-03-08 09:30:30 -0700 | [diff] [blame] | 149 | VKAPI_ATTR VkResult VKAPI_CALL |
Jon Ashburn | cc407a2 | 2016-04-15 09:25:03 -0600 | [diff] [blame] | 150 | terminator_GetDisplayPlaneSupportedDisplaysKHR(VkPhysicalDevice physicalDevice, |
| 151 | uint32_t planeIndex, |
| 152 | uint32_t *pDisplayCount, |
| 153 | VkDisplayKHR *pDisplays); |
Jon Ashburn | c7d3e73 | 2016-03-08 09:30:30 -0700 | [diff] [blame] | 154 | VKAPI_ATTR VkResult VKAPI_CALL |
Jon Ashburn | cc407a2 | 2016-04-15 09:25:03 -0600 | [diff] [blame] | 155 | terminator_GetDisplayModePropertiesKHR(VkPhysicalDevice physicalDevice, |
| 156 | VkDisplayKHR display, |
| 157 | uint32_t *pPropertyCount, |
| 158 | VkDisplayModePropertiesKHR *pProperties); |
Jon Ashburn | c7d3e73 | 2016-03-08 09:30:30 -0700 | [diff] [blame] | 159 | VKAPI_ATTR VkResult VKAPI_CALL |
Jon Ashburn | cc407a2 | 2016-04-15 09:25:03 -0600 | [diff] [blame] | 160 | terminator_CreateDisplayModeKHR(VkPhysicalDevice physicalDevice, |
| 161 | VkDisplayKHR display, |
| 162 | const VkDisplayModeCreateInfoKHR *pCreateInfo, |
| 163 | const VkAllocationCallbacks *pAllocator, |
| 164 | VkDisplayModeKHR *pMode); |
| 165 | VKAPI_ATTR VkResult VKAPI_CALL terminator_GetDisplayPlaneCapabilitiesKHR( |
| 166 | VkPhysicalDevice physicalDevice, VkDisplayModeKHR mode, uint32_t planeIndex, |
| 167 | VkDisplayPlaneCapabilitiesKHR *pCapabilities); |
| 168 | VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDisplayPlaneSurfaceKHR( |
| 169 | VkInstance instance, const VkDisplaySurfaceCreateInfoKHR *pCreateInfo, |
Jon Ashburn | 3ebf125 | 2016-04-19 11:30:31 -0600 | [diff] [blame] | 170 | const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface); |
Piers Daniell | f9262be | 2016-09-14 11:24:36 -0600 | [diff] [blame] | 171 | |
| 172 | #endif /* WSI_H */ |