diff --git a/rpcs3/CMakeLists.txt b/rpcs3/CMakeLists.txt index 182d818f04..226a126f26 100644 --- a/rpcs3/CMakeLists.txt +++ b/rpcs3/CMakeLists.txt @@ -27,6 +27,10 @@ if(UNIX AND NOT APPLE) if(X11_FOUND) add_definitions(-DHAVE_X11) endif() + find_package(Wayland) + if(WAYLAND_FOUND) + add_definitions(-DHAVE_WAYLAND) + endif() endif() # Qt diff --git a/rpcs3/Emu/RSX/VK/vkutils/instance.hpp b/rpcs3/Emu/RSX/VK/vkutils/instance.hpp index 61e2f107c7..19ae72f9e0 100644 --- a/rpcs3/Emu/RSX/VK/vkutils/instance.hpp +++ b/rpcs3/Emu/RSX/VK/vkutils/instance.hpp @@ -328,7 +328,7 @@ namespace vk } else #endif -#ifdef VK_USE_PLATFORM_WAYLAND_KHR +#ifdef HAVE_WAYLAND if constexpr (std::is_same_v>) { VkWaylandSurfaceCreateInfoKHR createInfo = {}; diff --git a/rpcs3/rpcs3qt/gs_frame.cpp b/rpcs3/rpcs3qt/gs_frame.cpp index e5faf27543..c172b11d12 100644 --- a/rpcs3/rpcs3qt/gs_frame.cpp +++ b/rpcs3/rpcs3qt/gs_frame.cpp @@ -35,7 +35,7 @@ #elif defined(__APPLE__) //nothing #else -#ifdef VK_USE_PLATFORM_WAYLAND_KHR +#ifdef HAVE_WAYLAND #include #include #endif @@ -712,7 +712,7 @@ display_handle_t gs_frame::handle() const #elif defined(__APPLE__) return reinterpret_cast(this->winId()); //NSView #else -#ifdef VK_USE_PLATFORM_WAYLAND_KHR +#ifdef HAVE_WAYLAND QPlatformNativeInterface *native = QGuiApplication::platformNativeInterface(); struct wl_display *wl_dpy = static_cast( native->nativeResourceForWindow("display", NULL)); @@ -723,16 +723,14 @@ display_handle_t gs_frame::handle() const return std::make_pair(wl_dpy, wl_surf); } else - { #endif #ifdef HAVE_X11 + { return std::make_pair(XOpenDisplay(0), static_cast(this->winId())); + } #else fmt::throw_exception("Vulkan X11 support disabled at compile-time."); #endif -#ifdef VK_USE_PLATFORM_WAYLAND_KHR - } -#endif #endif }