Skip to content

Commit d4e5449

Browse files
committed
Wayland support (vk only)
1 parent 3474816 commit d4e5449

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,17 +102,17 @@ void SwapChainVkImpl::CreateSurface()
102102

103103
err = vkCreateMetalSurfaceEXT(m_Instance->GetVkInstance(), &surfaceCreateInfo, NULL, &m_VkSurface);
104104
}
105-
#elif defined(VK_USE_PLATFORM_WAYLAND_KHR)
106-
if (m_Window.pDisplay != nullptr)
105+
#elif defined(VK_USE_PLATFORM_WAYLAND_KHR) || defined(VK_USE_PLATFORM_XCB_KHR) || defined(VK_USE_PLATFORM_XLIB_KHR)
106+
# if defined(VK_USE_PLATFORM_WAYLAND_KHR)
107+
if (m_Window.pDisplay != nullptr && m_Window.pWaylandSurface != nullptr)
107108
{
108109
VkWaylandSurfaceCreateInfoKHR surfaceCreateInfo{};
109110
surfaceCreateInfo.sType = VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR;
110-
surfaceCreateInfo.display = reinterpret_cast<struct wl_display*>(m_Window.pDisplay);
111-
surfaceCreateInfo.Surface = reinterpret_cast<struct wl_surface*>(nullptr);
112-
111+
surfaceCreateInfo.display = static_cast<wl_display*>(m_Window.pDisplay);
112+
surfaceCreateInfo.surface = static_cast<wl_surface*>(m_Window.pWaylandSurface);
113113
err = vkCreateWaylandSurfaceKHR(m_Instance->GetVkInstance(), &surfaceCreateInfo, nullptr, &m_VkSurface);
114114
}
115-
#elif defined(VK_USE_PLATFORM_XCB_KHR) || defined(VK_USE_PLATFORM_XLIB_KHR)
115+
# endif
116116

117117
# if defined(VK_USE_PLATFORM_XCB_KHR)
118118
if (m_Window.pXCBConnection != nullptr && m_Window.WindowId != 0)

Platforms/Linux/interface/LinuxNativeWindow.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ DILIGENT_BEGIN_NAMESPACE(Diligent)
3434

3535
struct LinuxNativeWindow
3636
{
37-
Uint32 WindowId DEFAULT_INITIALIZER(0);
38-
void* pDisplay DEFAULT_INITIALIZER(nullptr);
39-
void* pXCBConnection DEFAULT_INITIALIZER(nullptr);
37+
Uint32 WindowId DEFAULT_INITIALIZER(0);
38+
void* pDisplay DEFAULT_INITIALIZER(nullptr);
39+
void* pXCBConnection DEFAULT_INITIALIZER(nullptr);
40+
void* pWaylandSurface DEFAULT_INITIALIZER(nullptr);
4041
};
4142

4243
DILIGENT_END_NAMESPACE // namespace Diligent

0 commit comments

Comments
 (0)