Merge pull request #276 from tomek-brcm/wayland

Add Wayland WSI support
This commit is contained in:
Sascha Willems 2017-02-03 14:09:45 +01:00 committed by GitHub
commit f51345029b
7 changed files with 551 additions and 3 deletions

View file

@ -109,10 +109,14 @@ public:
#else
#ifdef _DIRECT2DISPLAY
uint32_t width, uint32_t height
#else
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
wl_display *display, wl_surface *window
#else
xcb_connection_t* connection, xcb_window_t window
#endif
#endif
#endif
#endif
)
{
@ -134,6 +138,13 @@ public:
#else
#if defined(_DIRECT2DISPLAY)
createDirect2DisplaySurface(width, height);
#else
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
VkWaylandSurfaceCreateInfoKHR surfaceCreateInfo = {};
surfaceCreateInfo.sType = VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR;
surfaceCreateInfo.display = display;
surfaceCreateInfo.surface = window;
err = vkCreateWaylandSurfaceKHR(instance, &surfaceCreateInfo, nullptr, &surface);
#else
VkXcbSurfaceCreateInfoKHR surfaceCreateInfo = {};
surfaceCreateInfo.sType = VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR;
@ -142,6 +153,7 @@ public:
err = vkCreateXcbSurfaceKHR(instance, &surfaceCreateInfo, nullptr, &surface);
#endif
#endif
#endif
#endif
// Get available queue family properties