Ian Elliott | 1d73e66 | 2015-07-06 14:36:13 -0600 | [diff] [blame] | 1 | /* |
Jon Ashburn | 44aed66 | 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 | 1d73e66 | 2015-07-06 14:36:13 -0600 | [diff] [blame] | 5 | * |
Jon Ashburn | 44aed66 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | * of this software and/or associated documentation files (the "Materials"), to |
| 8 | * deal in the Materials without restriction, including without limitation the |
| 9 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 10 | * sell copies of the Materials, and to permit persons to whom the Materials are |
| 11 | * furnished to do so, subject to the following conditions: |
Ian Elliott | 1d73e66 | 2015-07-06 14:36:13 -0600 | [diff] [blame] | 12 | * |
Jon Ashburn | 44aed66 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 13 | * The above copyright notice(s) and this permission notice shall be included in |
| 14 | * all copies or substantial portions of the Materials. |
Ian Elliott | 1d73e66 | 2015-07-06 14:36:13 -0600 | [diff] [blame] | 15 | * |
Jon Ashburn | 44aed66 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 16 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
Ian Elliott | 1d73e66 | 2015-07-06 14:36:13 -0600 | [diff] [blame] | 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
Jon Ashburn | 44aed66 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 19 | * |
| 20 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
| 21 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
| 22 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE |
| 23 | * USE OR OTHER DEALINGS IN THE MATERIALS. |
Ian Elliott | 1d73e66 | 2015-07-06 14:36:13 -0600 | [diff] [blame] | 24 | * |
Courtney Goeltzenleuchter | 96cd795 | 2015-10-30 11:14:30 -0600 | [diff] [blame] | 25 | * Author: Ian Elliott <ian@lunarg.com> |
| 26 | * |
Ian Elliott | 1d73e66 | 2015-07-06 14:36:13 -0600 | [diff] [blame] | 27 | */ |
| 28 | |
| 29 | #include "vk_loader_platform.h" |
| 30 | #include "loader.h" |
Ian Elliott | 1d73e66 | 2015-07-06 14:36:13 -0600 | [diff] [blame] | 31 | |
Jon Ashburn | 9945600 | 2015-11-06 11:02:40 -0700 | [diff] [blame] | 32 | bool wsi_swapchain_instance_gpa(struct loader_instance *ptr_instance, |
Jon Ashburn | 44aed66 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 33 | const char *name, void **addr); |
Ian Elliott | 1d73e66 | 2015-07-06 14:36:13 -0600 | [diff] [blame] | 34 | |
Jon Ashburn | 44aed66 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 35 | void wsi_create_instance(struct loader_instance *ptr_instance, |
| 36 | const VkInstanceCreateInfo *pCreateInfo); |
Jon Ashburn | c666cff | 2016-03-25 12:49:35 -0600 | [diff] [blame] | 37 | bool wsi_unsupported_instance_extension(const VkExtensionProperties *ext_prop); |
Ian Elliott | 1d73e66 | 2015-07-06 14:36:13 -0600 | [diff] [blame] | 38 | |
Jon Ashburn | 44aed66 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 39 | VKAPI_ATTR void VKAPI_CALL |
Jon Ashburn | a9c4a57 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 40 | terminator_DestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface, |
| 41 | const VkAllocationCallbacks *pAllocator); |
Ian Elliott | 1d73e66 | 2015-07-06 14:36:13 -0600 | [diff] [blame] | 42 | |
Jon Ashburn | 44aed66 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 43 | VKAPI_ATTR VkResult VKAPI_CALL |
Jon Ashburn | a9c4a57 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 44 | terminator_GetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, |
| 45 | uint32_t queueFamilyIndex, |
| 46 | VkSurfaceKHR surface, |
| 47 | VkBool32 *pSupported); |
Ian Elliott | 8cda180 | 2015-11-19 16:05:09 -0700 | [diff] [blame] | 48 | |
Jon Ashburn | a9c4a57 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 49 | VKAPI_ATTR VkResult VKAPI_CALL |
| 50 | terminator_GetPhysicalDeviceSurfaceCapabilitiesKHR( |
Jon Ashburn | 44aed66 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 51 | VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, |
| 52 | VkSurfaceCapabilitiesKHR *pSurfaceCapabilities); |
Ian Elliott | 8cda180 | 2015-11-19 16:05:09 -0700 | [diff] [blame] | 53 | |
Jon Ashburn | a9c4a57 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 54 | VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceFormatsKHR( |
| 55 | VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, |
| 56 | uint32_t *pSurfaceFormatCount, VkSurfaceFormatKHR *pSurfaceFormats); |
Ian Elliott | 8cda180 | 2015-11-19 16:05:09 -0700 | [diff] [blame] | 57 | |
Jon Ashburn | 44aed66 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 58 | VKAPI_ATTR VkResult VKAPI_CALL |
Jon Ashburn | a9c4a57 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 59 | terminator_GetPhysicalDeviceSurfacePresentModesKHR( |
| 60 | VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, |
| 61 | uint32_t *pPresentModeCount, VkPresentModeKHR *pPresentModes); |
Ian Elliott | 4e309e9 | 2015-11-24 15:39:10 -0700 | [diff] [blame] | 62 | |
| 63 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
Jon Ashburn | 44aed66 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 64 | VKAPI_ATTR VkResult VKAPI_CALL |
Jon Ashburn | a9c4a57 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 65 | terminator_CreateWin32SurfaceKHR(VkInstance instance, |
| 66 | const VkWin32SurfaceCreateInfoKHR *pCreateInfo, |
| 67 | const VkAllocationCallbacks *pAllocator, |
| 68 | VkSurfaceKHR *pSurface); |
Jon Ashburn | 44aed66 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 69 | VKAPI_ATTR VkBool32 VKAPI_CALL |
Jon Ashburn | a9c4a57 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 70 | terminator_GetPhysicalDeviceWin32PresentationSupportKHR( |
Jon Ashburn | 44aed66 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 71 | VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex); |
Ian Elliott | 4e309e9 | 2015-11-24 15:39:10 -0700 | [diff] [blame] | 72 | #endif |
| 73 | #ifdef VK_USE_PLATFORM_MIR_KHR |
Jon Ashburn | 44aed66 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 74 | VKAPI_ATTR VkResult VKAPI_CALL |
Jon Ashburn | a9c4a57 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 75 | terminator_CreateMirSurfaceKHR(VkInstance instance, |
| 76 | const VkMirSurfaceCreateInfoKHR *pCreateInfo, |
| 77 | const VkAllocationCallbacks *pAllocator, |
| 78 | VkSurfaceKHR *pSurface); |
Jon Ashburn | 44aed66 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 79 | VKAPI_ATTR VkBool32 VKAPI_CALL |
Jon Ashburn | a9c4a57 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 80 | terminator_GetPhysicalDeviceMirPresentationSupportKHR( |
Jon Ashburn | 44aed66 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 81 | VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, |
| 82 | MirConnection *connection); |
Ian Elliott | 4e309e9 | 2015-11-24 15:39:10 -0700 | [diff] [blame] | 83 | #endif |
| 84 | #ifdef VK_USE_PLATFORM_WAYLAND_KHR |
Jon Ashburn | a9c4a57 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 85 | VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateWaylandSurfaceKHR( |
| 86 | VkInstance instance, const VkWaylandSurfaceCreateInfoKHR *pCreateInfo, |
| 87 | const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface); |
Jon Ashburn | 44aed66 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 88 | VKAPI_ATTR VkBool32 VKAPI_CALL |
Jon Ashburn | a9c4a57 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 89 | terminator_GetPhysicalDeviceWaylandPresentationSupportKHR( |
Jon Ashburn | 44aed66 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 90 | VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, |
| 91 | struct wl_display *display); |
Ian Elliott | 4e309e9 | 2015-11-24 15:39:10 -0700 | [diff] [blame] | 92 | #endif |
| 93 | #ifdef VK_USE_PLATFORM_XCB_KHR |
Jon Ashburn | 44aed66 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 94 | VKAPI_ATTR VkResult VKAPI_CALL |
Jon Ashburn | a9c4a57 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 95 | terminator_CreateXcbSurfaceKHR(VkInstance instance, |
| 96 | const VkXcbSurfaceCreateInfoKHR *pCreateInfo, |
| 97 | const VkAllocationCallbacks *pAllocator, |
| 98 | VkSurfaceKHR *pSurface); |
Jon Ashburn | 25a158f | 2015-11-25 17:55:49 -0700 | [diff] [blame] | 99 | |
Jon Ashburn | 44aed66 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 100 | VKAPI_ATTR VkBool32 VKAPI_CALL |
Jon Ashburn | a9c4a57 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 101 | terminator_GetPhysicalDeviceXcbPresentationSupportKHR( |
Jon Ashburn | 44aed66 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 102 | VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, |
| 103 | xcb_connection_t *connection, xcb_visualid_t visual_id); |
Ian Elliott | 4e309e9 | 2015-11-24 15:39:10 -0700 | [diff] [blame] | 104 | #endif |
| 105 | #ifdef VK_USE_PLATFORM_XLIB_KHR |
Jon Ashburn | 44aed66 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 106 | VKAPI_ATTR VkResult VKAPI_CALL |
Jon Ashburn | a9c4a57 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 107 | terminator_CreateXlibSurfaceKHR(VkInstance instance, |
| 108 | const VkXlibSurfaceCreateInfoKHR *pCreateInfo, |
| 109 | const VkAllocationCallbacks *pAllocator, |
| 110 | VkSurfaceKHR *pSurface); |
Jon Ashburn | 44aed66 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 111 | VKAPI_ATTR VkBool32 VKAPI_CALL |
Jon Ashburn | a9c4a57 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 112 | terminator_GetPhysicalDeviceXlibPresentationSupportKHR( |
Jon Ashburn | 44aed66 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 113 | VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, Display *dpy, |
| 114 | VisualID visualID); |
Ian Elliott | 4e309e9 | 2015-11-24 15:39:10 -0700 | [diff] [blame] | 115 | #endif |
Jon Ashburn | 9b2a8c9 | 2016-04-15 09:25:03 -0600 | [diff] [blame] | 116 | VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceDisplayPropertiesKHR( |
| 117 | VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, |
| 118 | VkDisplayPropertiesKHR *pProperties); |
Jon Ashburn | 00df045 | 2016-03-08 09:30:30 -0700 | [diff] [blame] | 119 | VKAPI_ATTR VkResult VKAPI_CALL |
| 120 | terminator_GetPhysicalDeviceDisplayPlanePropertiesKHR( |
Jon Ashburn | 9b2a8c9 | 2016-04-15 09:25:03 -0600 | [diff] [blame] | 121 | VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, |
| 122 | VkDisplayPlanePropertiesKHR *pProperties); |
Jon Ashburn | 00df045 | 2016-03-08 09:30:30 -0700 | [diff] [blame] | 123 | VKAPI_ATTR VkResult VKAPI_CALL |
Jon Ashburn | 9b2a8c9 | 2016-04-15 09:25:03 -0600 | [diff] [blame] | 124 | terminator_GetDisplayPlaneSupportedDisplaysKHR(VkPhysicalDevice physicalDevice, |
| 125 | uint32_t planeIndex, |
| 126 | uint32_t *pDisplayCount, |
| 127 | VkDisplayKHR *pDisplays); |
Jon Ashburn | 00df045 | 2016-03-08 09:30:30 -0700 | [diff] [blame] | 128 | VKAPI_ATTR VkResult VKAPI_CALL |
Jon Ashburn | 9b2a8c9 | 2016-04-15 09:25:03 -0600 | [diff] [blame] | 129 | terminator_GetDisplayModePropertiesKHR(VkPhysicalDevice physicalDevice, |
| 130 | VkDisplayKHR display, |
| 131 | uint32_t *pPropertyCount, |
| 132 | VkDisplayModePropertiesKHR *pProperties); |
Jon Ashburn | 00df045 | 2016-03-08 09:30:30 -0700 | [diff] [blame] | 133 | VKAPI_ATTR VkResult VKAPI_CALL |
Jon Ashburn | 9b2a8c9 | 2016-04-15 09:25:03 -0600 | [diff] [blame] | 134 | terminator_CreateDisplayModeKHR(VkPhysicalDevice physicalDevice, |
| 135 | VkDisplayKHR display, |
| 136 | const VkDisplayModeCreateInfoKHR *pCreateInfo, |
| 137 | const VkAllocationCallbacks *pAllocator, |
| 138 | VkDisplayModeKHR *pMode); |
| 139 | VKAPI_ATTR VkResult VKAPI_CALL terminator_GetDisplayPlaneCapabilitiesKHR( |
| 140 | VkPhysicalDevice physicalDevice, VkDisplayModeKHR mode, uint32_t planeIndex, |
| 141 | VkDisplayPlaneCapabilitiesKHR *pCapabilities); |
| 142 | VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDisplayPlaneSurfaceKHR( |
| 143 | VkInstance instance, const VkDisplaySurfaceCreateInfoKHR *pCreateInfo, |
| 144 | const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface); |