2016-02-18 01:42:25 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2015-2016 The Khronos Group Inc.
|
|
|
|
* Copyright (c) 2015-2016 Valve Corporation
|
|
|
|
* Copyright (c) 2015-2016 LunarG, Inc.
|
|
|
|
*
|
2016-06-18 00:32:21 +00:00
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
2016-02-18 01:42:25 +00:00
|
|
|
*
|
2016-06-18 00:32:21 +00:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2016-02-18 01:42:25 +00:00
|
|
|
*
|
2016-06-18 00:32:21 +00:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
2016-02-18 01:42:25 +00:00
|
|
|
*
|
|
|
|
* Author: Ian Elliott <ian@lunarg.com>
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2016-11-23 03:29:18 +00:00
|
|
|
#ifndef WSI_H
|
|
|
|
#define WSI_H
|
|
|
|
|
2016-02-18 01:42:25 +00:00
|
|
|
#include "vk_loader_platform.h"
|
|
|
|
#include "loader.h"
|
|
|
|
|
2016-11-23 03:29:18 +00:00
|
|
|
typedef struct {
|
|
|
|
union {
|
|
|
|
#ifdef VK_USE_PLATFORM_MIR_KHR
|
|
|
|
VkIcdSurfaceMir mir_surf;
|
2017-05-12 01:09:31 +00:00
|
|
|
#endif // VK_USE_PLATFORM_MIR_KHR
|
2016-11-23 03:29:18 +00:00
|
|
|
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
|
|
|
|
VkIcdSurfaceWayland wayland_surf;
|
2017-05-12 01:09:31 +00:00
|
|
|
#endif // VK_USE_PLATFORM_WAYLAND_KHR
|
2016-11-23 03:29:18 +00:00
|
|
|
#ifdef VK_USE_PLATFORM_WIN32_KHR
|
|
|
|
VkIcdSurfaceWin32 win_surf;
|
2017-05-12 01:09:31 +00:00
|
|
|
#endif // VK_USE_PLATFORM_WIN32_KHR
|
2016-11-23 03:29:18 +00:00
|
|
|
#ifdef VK_USE_PLATFORM_XCB_KHR
|
|
|
|
VkIcdSurfaceXcb xcb_surf;
|
2017-05-12 01:09:31 +00:00
|
|
|
#endif // VK_USE_PLATFORM_XCB_KHR
|
2016-11-23 03:29:18 +00:00
|
|
|
#ifdef VK_USE_PLATFORM_XLIB_KHR
|
|
|
|
VkIcdSurfaceXlib xlib_surf;
|
2017-05-12 01:09:31 +00:00
|
|
|
#endif // VK_USE_PLATFORM_XLIB_KHR
|
2016-11-23 03:29:18 +00:00
|
|
|
VkIcdSurfaceDisplay display_surf;
|
|
|
|
};
|
2017-05-12 01:09:31 +00:00
|
|
|
uint32_t base_size; // Size of VkIcdSurfaceBase
|
|
|
|
uint32_t platform_size; // Size of corresponding VkIcdSurfaceXXX
|
|
|
|
uint32_t non_platform_offset; // Start offset to base_size
|
|
|
|
uint32_t entire_size; // Size of entire VkIcdSurface
|
2016-11-23 03:29:18 +00:00
|
|
|
VkSurfaceKHR *real_icd_surfaces;
|
|
|
|
} VkIcdSurface;
|
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
bool wsi_swapchain_instance_gpa(struct loader_instance *ptr_instance, const char *name, void **addr);
|
2016-02-18 01:42:25 +00:00
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
void wsi_create_instance(struct loader_instance *ptr_instance, const VkInstanceCreateInfo *pCreateInfo);
|
2016-06-18 00:32:21 +00:00
|
|
|
bool wsi_unsupported_instance_extension(const VkExtensionProperties *ext_prop);
|
2016-02-18 01:42:25 +00:00
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo,
|
|
|
|
const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchain);
|
2016-11-23 03:29:18 +00:00
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
VKAPI_ATTR void VKAPI_CALL terminator_DestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface,
|
|
|
|
const VkAllocationCallbacks *pAllocator);
|
2016-02-18 01:42:25 +00:00
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice,
|
|
|
|
uint32_t queueFamilyIndex, VkSurfaceKHR surface,
|
|
|
|
VkBool32 *pSupported);
|
2016-02-18 01:42:25 +00:00
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice,
|
|
|
|
VkSurfaceKHR surface,
|
|
|
|
VkSurfaceCapabilitiesKHR *pSurfaceCapabilities);
|
2016-02-18 01:42:25 +00:00
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface,
|
|
|
|
uint32_t *pSurfaceFormatCount,
|
|
|
|
VkSurfaceFormatKHR *pSurfaceFormats);
|
2016-02-18 01:42:25 +00:00
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice,
|
|
|
|
VkSurfaceKHR surface, uint32_t *pPresentModeCount,
|
|
|
|
VkPresentModeKHR *pPresentModes);
|
2016-02-18 01:42:25 +00:00
|
|
|
|
|
|
|
#ifdef VK_USE_PLATFORM_WIN32_KHR
|
2017-05-12 01:09:31 +00:00
|
|
|
VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateWin32SurfaceKHR(VkInstance instance, const VkWin32SurfaceCreateInfoKHR *pCreateInfo,
|
|
|
|
const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface);
|
|
|
|
VKAPI_ATTR VkBool32 VKAPI_CALL terminator_GetPhysicalDeviceWin32PresentationSupportKHR(VkPhysicalDevice physicalDevice,
|
|
|
|
uint32_t queueFamilyIndex);
|
2016-02-18 01:42:25 +00:00
|
|
|
#endif
|
|
|
|
#ifdef VK_USE_PLATFORM_MIR_KHR
|
2017-05-12 01:09:31 +00:00
|
|
|
VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateMirSurfaceKHR(VkInstance instance, const VkMirSurfaceCreateInfoKHR *pCreateInfo,
|
|
|
|
const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface);
|
|
|
|
VKAPI_ATTR VkBool32 VKAPI_CALL terminator_GetPhysicalDeviceMirPresentationSupportKHR(VkPhysicalDevice physicalDevice,
|
|
|
|
uint32_t queueFamilyIndex,
|
|
|
|
MirConnection *connection);
|
2016-02-18 01:42:25 +00:00
|
|
|
#endif
|
|
|
|
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
|
2017-05-12 01:09:31 +00:00
|
|
|
VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateWaylandSurfaceKHR(VkInstance instance,
|
|
|
|
const VkWaylandSurfaceCreateInfoKHR *pCreateInfo,
|
|
|
|
const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface);
|
|
|
|
VKAPI_ATTR VkBool32 VKAPI_CALL terminator_GetPhysicalDeviceWaylandPresentationSupportKHR(VkPhysicalDevice physicalDevice,
|
|
|
|
uint32_t queueFamilyIndex,
|
|
|
|
struct wl_display *display);
|
2016-02-18 01:42:25 +00:00
|
|
|
#endif
|
|
|
|
#ifdef VK_USE_PLATFORM_XCB_KHR
|
2017-05-12 01:09:31 +00:00
|
|
|
VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateXcbSurfaceKHR(VkInstance instance, const VkXcbSurfaceCreateInfoKHR *pCreateInfo,
|
|
|
|
const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface);
|
2016-02-18 01:42:25 +00:00
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
VKAPI_ATTR VkBool32 VKAPI_CALL terminator_GetPhysicalDeviceXcbPresentationSupportKHR(VkPhysicalDevice physicalDevice,
|
|
|
|
uint32_t queueFamilyIndex,
|
|
|
|
xcb_connection_t *connection,
|
|
|
|
xcb_visualid_t visual_id);
|
2016-02-18 01:42:25 +00:00
|
|
|
#endif
|
|
|
|
#ifdef VK_USE_PLATFORM_XLIB_KHR
|
2017-05-12 01:09:31 +00:00
|
|
|
VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateXlibSurfaceKHR(VkInstance instance, const VkXlibSurfaceCreateInfoKHR *pCreateInfo,
|
|
|
|
const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface);
|
|
|
|
VKAPI_ATTR VkBool32 VKAPI_CALL terminator_GetPhysicalDeviceXlibPresentationSupportKHR(VkPhysicalDevice physicalDevice,
|
|
|
|
uint32_t queueFamilyIndex, Display *dpy,
|
|
|
|
VisualID visualID);
|
2016-02-18 01:42:25 +00:00
|
|
|
#endif
|
2017-05-12 01:09:31 +00:00
|
|
|
VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceDisplayPropertiesKHR(VkPhysicalDevice physicalDevice,
|
|
|
|
uint32_t *pPropertyCount,
|
|
|
|
VkDisplayPropertiesKHR *pProperties);
|
|
|
|
VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceDisplayPlanePropertiesKHR(VkPhysicalDevice physicalDevice,
|
|
|
|
uint32_t *pPropertyCount,
|
|
|
|
VkDisplayPlanePropertiesKHR *pProperties);
|
|
|
|
VKAPI_ATTR VkResult VKAPI_CALL terminator_GetDisplayPlaneSupportedDisplaysKHR(VkPhysicalDevice physicalDevice, uint32_t planeIndex,
|
|
|
|
uint32_t *pDisplayCount, VkDisplayKHR *pDisplays);
|
|
|
|
VKAPI_ATTR VkResult VKAPI_CALL terminator_GetDisplayModePropertiesKHR(VkPhysicalDevice physicalDevice, VkDisplayKHR display,
|
|
|
|
uint32_t *pPropertyCount,
|
|
|
|
VkDisplayModePropertiesKHR *pProperties);
|
|
|
|
VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDisplayModeKHR(VkPhysicalDevice physicalDevice, VkDisplayKHR display,
|
|
|
|
const VkDisplayModeCreateInfoKHR *pCreateInfo,
|
|
|
|
const VkAllocationCallbacks *pAllocator, VkDisplayModeKHR *pMode);
|
|
|
|
VKAPI_ATTR VkResult VKAPI_CALL terminator_GetDisplayPlaneCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkDisplayModeKHR mode,
|
|
|
|
uint32_t planeIndex,
|
|
|
|
VkDisplayPlaneCapabilitiesKHR *pCapabilities);
|
|
|
|
VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDisplayPlaneSurfaceKHR(VkInstance instance,
|
|
|
|
const VkDisplaySurfaceCreateInfoKHR *pCreateInfo,
|
|
|
|
const VkAllocationCallbacks *pAllocator,
|
|
|
|
VkSurfaceKHR *pSurface);
|
2016-11-23 03:29:18 +00:00
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateSharedSwapchainsKHR(VkDevice device, uint32_t swapchainCount,
|
|
|
|
const VkSwapchainCreateInfoKHR *pCreateInfos,
|
|
|
|
const VkAllocationCallbacks *pAllocator,
|
|
|
|
VkSwapchainKHR *pSwapchains);
|
2017-01-27 05:57:54 +00:00
|
|
|
|
2017-05-12 01:09:31 +00:00
|
|
|
#endif // WSI_H
|